The R Project SVN R

Rev

Rev 64607 | Rev 83087 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 64607 Rev 64625
Line 29... Line 29...
29
z2 <- with(d, ISOdate(year, 12, day))
29
z2 <- with(d, ISOdate(year, 12, day))
30
z <- sort(c(z1, z2))
30
z <- sort(c(z1, z2))
31
strftime(z, "%G %g %W %U %u %V %W %w")
31
strftime(z, "%G %g %W %U %u %V %W %w")
32
 
32
 
33
## tests of earlier years.  Default format is OS-dependent, so don't test it.
33
## tests of earlier years.  Default format is OS-dependent, so don't test it.
-
 
34
## ISOdate only accepts positive years.
34
z <- as.Date(ISOdate(c(0, 8, 9, 10, 11, 20, 110, 1010), 1, 10)) - 3630
35
z <- as.Date(ISOdate(c(0, 8, 9, 10, 11, 20, 110, 1010), 1, 10)) - 3630
35
strftime(z, "%4Y-%m-%d") # with leading zero(s)
36
strftime(z, "%04Y-%m-%d") # with leading zero(s)
-
 
37
strftime(z, "%_4Y-%m-%d") # with leading space(s)
36
strftime(z, "%_Y-%m-%d") # without
38
strftime(z, "%0Y-%m-%d") # without
37
 
39
 
38
 
40
 
39
## more test of strftime
41
## more test of strftime
40
x <- ISOdate(2014, 3, 10, c(7, 13))
42
x <- ISOdate(2014, 3, 10, c(7, 13))
41
fmts <- c("%Y-%m-%d %H:%M:%S", "%F", "%A %a %b %h %e %I %j",
43
fmts <- c("%Y-%m-%d %H:%M:%S", "%F", "%A %a %b %h %e %I %j",