Re: [R] Strange behaviour of as.POSIXct

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue, 27 May 2008 07:02:02 +0100 (BST)

>From the help page for strptime

      Remember that in most timezones some times do not occur and some
      occur twice because of transitions to/from summer time.  What
      happens in those cases is OS-specific.

Now Switzerland will have times in CET and not in EST5EDT, and the DST transition times are different in different countries. Add tz="CET" to your call (or "Europe/Zurich").

On Mon, 26 May 2008, Josephy, Norman wrote:

> Hi:
>
> I do not understand the returned value of NA in the following, which is
> a simplified version of my attempt to convert the start column of the
> data frame AirQual in the SwissAir package.
>
> as.POSIXct(paste('04.04.2004 0',0:3,sep=''),format='%d.%m.%Y %H')
> [1] "2004-04-04 00:00:00 EST" "2004-04-04 01:00:00 EST"
> [3] NA "2004-04-04 03:00:00 EDT"
>
> My sessionInfo() is
>
> sessionInfo()
> R version 2.7.0 (2008-04-22)
> i386-pc-mingw32
> locale:
> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
> attached base packages:
> [1] stats graphics grDevices utils datasets methods
> [7] base
>
> Thank you,
>
> Norm
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 27 May 2008 - 06:08:41 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 27 May 2008 - 06:30:40 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive