The R Project SVN R

Rev

Rev 73855 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 73855 Rev 75365
Line 12... Line 12...
12
c(unclass(z))
12
c(unclass(z))
13
 
13
 
14
Sys.setenv(TZ = "Europe/London")  # pretty much portable.
14
Sys.setenv(TZ = "Europe/London")  # pretty much portable.
15
(z <- as.POSIXct("1848-01-01 12:00"))
15
(z <- as.POSIXct("1848-01-01 12:00"))
16
c(unclass(z))
16
c(unclass(z))
-
 
17
## We don't know the operation of timezones next year let alone in 1940
-
 
18
## but these should at least round-trip
17
(z <- as.POSIXct("2040-01-01 12:00"))
19
as.POSIXct("2040-01-01 12:00")
18
c(unclass(z))
-
 
19
(z <- as.POSIXct("2040-07-01 12:00"))
20
as.POSIXct("2040-07-01 12:00")
20
c(unclass(z))
-
 
21
 
21
 
22
Sys.setenv(TZ = "EST5EDT")
22
Sys.setenv(TZ = "EST5EDT")  # also pretty much portable.
23
(z <- as.POSIXct("1848-01-01 12:00"))
23
(z <- as.POSIXct("1848-01-01 12:00"))
24
c(unclass(z))
24
c(unclass(z))
25
(z <- as.POSIXct("2040-01-01 12:00"))
25
as.POSIXct("2040-01-01 12:00")
26
c(unclass(z))
-
 
27
(z <- as.POSIXct("2040-07-01 12:00"))
26
as.POSIXct("2040-07-01 12:00")
28
c(unclass(z))
-
 
29
 
27
 
30
## PR15613: had day as > 24hrs.
28
## PR15613: had day as > 24hrs.
31
as.POSIXlt(ISOdate(2071,1,13,0,0,tz="Etc/GMT-1"))$wday
29
as.POSIXlt(ISOdate(2071,1,13,0,0,tz="Etc/GMT-1"))$wday
32
as.POSIXlt(ISOdate(2071,1,13,0,1,tz="Etc/GMT-1"))$wday
30
as.POSIXlt(ISOdate(2071,1,13,0,1,tz="Etc/GMT-1"))$wday
33
 
31
 
34
 
32
 
35
## Incorrect use of %d should work even though abbreviation does match
33
## Incorrect use of %b should work even though abbreviation does match
36
old <- Sys.setlocale("LC_TIME", "C") # to be sure
34
old <- Sys.setlocale("LC_TIME", "C") # to be sure
37
stopifnot(!is.na(strptime("11-August-1903", "%d-%b-%Y")))
35
stopifnot(!is.na(strptime("11-August-1903", "%d-%b-%Y")))