[R] Problem to convert date to number

Chris82 rubenbauar at gmx.de
Wed Apr 6 13:55:57 CEST 2011


Hi R users,

I have a maybe small problem which I cannot solve by myself.

I want to convert 

"chron" "dates" "times"

(04/30/06 11:35:00)


to a number with as.POSIXct.

The Problem is that I can't choose different timezones. I always get "CEST"
and not "UTC" what I need.  

date = as.POSIXct(y,tz="UTC")

"2006-04-30 11:35:00 CEST"

Then I tried to use as.POSIXlt.

date = as.POSIXlt(y,tz="UTC")

"2006-04-30 11:35:00 UTC"

The advantage is I get time in UTC but now the problem is that I can
calculate numbers.

date <- as.double(date)/86400

it is not working with  as.POSIXlt but with as.POSIXct

 
Thanks!

With best regards



--
View this message in context: http://r.789695.n4.nabble.com/Problem-to-convert-date-to-number-tp3430571p3430571.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list