Skip to content
Prev 157278 / 398506 Next

Date Time conversion

chron uses:

- separate arguments for date and time -- not a single one as you have
- a separate system for the codes, not the % codes of Date and POSIXt classes

If you want to specify the date and time all as one string
rather than two arguments, use as.chron instead of
chron -- as.chron does use the same percent codes
as Date and POSIXct.  Notice further that the percent
codes used in the question were wrong with respect to
hours and minutes and should be as follows:

as.chron(as.character(f), "%m/%d/%y %H:%M")

Suggest you spend a few minutes going over the relevant
article in R News 4/1 -- although that does not cover as.chron
used in the above way as that was added a few years after
the article was written.
On Fri, Sep 26, 2008 at 10:18 AM, stephen sefick <ssefick at gmail.com> wrote: