chron yy/mm/dd

Kurt Hornik
Fri, 10 Dec 1999 10:29:39 +0100 (CET)

>>>>> Paul Gilbert writes:

> I'm not too familiar with chron, but I don't think it should drop the
> month and day in the second example following example:

>> chron(20000, format="y/m/d")
> [1] 124/10/04
>> chron(20000, format="yy/m/d")
> [1] 2024


This simply is not supported.  Look at parse.format() in the chron pkg.
What it does is

* if format has 5 chars, parse as "a/b/c"

* if format has 3 chars, parse as "abc"

* else parse as "a b c" (and do not abbreviate month names if "month" is

In you example, we get

R> unlist(parse.format("yy/m/d"))
    abb     sep periods 
"FALSE"     " "     "y"  "TRUE" 

and hence we only get the years.

Hope this helps.

r-devel mailing list -- Read
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: