[R] Problem to convert date to number

From: Chris82 <rubenbauar_at_gmx.de>
Date: Wed, 06 Apr 2011 04:55:57 -0700 (PDT)


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.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 06 Apr 2011 - 11:57:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 06 Apr 2011 - 13:20:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive