[R] Milliseconds and Time object

peter dalgaard pdalgd at gmail.com
Tue Oct 19 13:44:21 CEST 2010


On Oct 19, 2010, at 12:12 , jim holtman wrote:

> Is this what you are after:
> 
>> date <- '2010-10-19'
>> as.POSIXct(date)
> [1] "2010-10-19 EDT"
>> milli <- 3600000  # one hour in milliseconds
>> as.POSIXct(date) + milli / 1000
> [1] "2010-10-19 01:00:00 EDT"
>> 
> 

Beware timezone and DST issues though. It might be safer to standardize on GMT (just add tz="GMT" to the as.POSIXct() call.)


-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list