to.posixt | R Documentation |
Convert an object of class Date to class POSIXct without getting bogged down in timezone calculation.
DateToPOSIX(timestamps)
YearMonToPOSIX(timestamps)
timestamps |
An object of class |
Calling as.POSIXct
on another date/time object
(e.g. Date) applies a timezone correction to the object. This can
shift the time marker by a few hours, which can have the effect of
shifting the day by one unit. If the day was the first or last in a
month or year, then the month or year will be off by one as well.
Coercing the object to the character representation of a Date prevents this adjustment from being applied, and leaves the POSIXt return value with the intended day, month, and year.
Steven L. Scott steve.the.bayesian@gmail.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.