Skip to content

DateTime Math in R - POSIXct

4 messages · Galen Moore, David Winsemius, Bill Venables

#
On May 30, 2011, at 10:20 PM, Galen Moore wrote:

            
So now the internal representation is referenced to GMT
And you are telling the function to add as many hours offset as needed  
for the difference between GMT and MD T.....
#
Perhaps because the timezone is specified as a character string and not a date-time object complete with timezone.
"origin: 	a date-time object, or something which can be coerced by as.POSIXct(tz="GMT") to such an object." 

Note the coercion.

Bill Venables.


-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Galen Moore
Sent: Tuesday, 31 May 2011 12:20 PM
To: r-help at r-project.org
Subject: [R] DateTime Math in R - POSIXct

Greetings - 

 

I'm battling POSIXct, as per the code below.  My input is actually an XL
file, but the weird results below correctly model what I am seeing in my
program.

 

Before I punt and use lubridate or timeDate, could anyone please help me
understand why POSIXct forces my variable back to GMT?

 

I suspect that I'm not properly coding the tzone value, but it does not
throw an error as-is.
[1] "character"
[1] "numeric"
[1] "2011-05-22 11:45:00 MDT"
[1] 1306086300
[1] "2011-05-22 18:45:00 MDT"

 

Many thanks.

 

Galen Moore



______________________________________________
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.
#
I think that has something to do with it.  I'll keep chewing on things and
see what I can make work.

I've reached a point where I get the right answer for the wrong reasons....
;-)

Many thanks,

Galen

-----Original Message-----
From: Bill.Venables at csiro.au [mailto:Bill.Venables at csiro.au] 
Sent: Monday, May 30, 2011 21:22
To: galen.a.moore at gmail.com; r-help at r-project.org
Subject: RE: [R] DateTime Math in R - POSIXct

Perhaps because the timezone is specified as a character string and not a
date-time object complete with timezone.
"origin: 	a date-time object, or something which can be coerced by
as.POSIXct(tz="GMT") to such an object." 

Note the coercion.

Bill Venables.


-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Galen Moore
Sent: Tuesday, 31 May 2011 12:20 PM
To: r-help at r-project.org
Subject: [R] DateTime Math in R - POSIXct

Greetings - 

 

I'm battling POSIXct, as per the code below.  My input is actually an XL
file, but the weird results below correctly model what I am seeing in my
program.

 

Before I punt and use lubridate or timeDate, could anyone please help me
understand why POSIXct forces my variable back to GMT?

 

I suspect that I'm not properly coding the tzone value, but it does not
throw an error as-is.
[1] "character"
[1] "numeric"
[1] "2011-05-22 11:45:00 MDT"
[1] 1306086300
[1] "2011-05-22 18:45:00 MDT"

 

Many thanks.

 

Galen Moore



______________________________________________
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.