[R] Unable to return gmtoff from as.POSIXlt without converting date string to as.POSIXct first

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Fri Jun 29 00:16:30 CEST 2018



regarding gmtoff. In short, it is implementation-dependent.

On June 28, 2018 10:58:13 AM PDT, Sam Albers <tonightsthenight using gmail.com> wrote:
>Is it possible for someone to explain what is going on here? I would
>that `as.POSIXlt` would be able to accept `datestring` and return all
>elements without having to convert it using `as.POSIXct` first. Do
>`as.POSIXlt` and `as.POSIXct` do different things with the `tz` arg?
>datestring <- "2017-01-01 12:00:00"
>foo <- as.POSIXlt(datestring, tz = "America/Moncton")
>[1] "2017-01-01 12:00:00 AST"
>[1] NA
>bar <- as.POSIXlt(as.POSIXct(datestring, tz = "America/Moncton"))
>[1] "2017-01-01 12:00:00 AST"
>[1] -14400
>Thanks in advance,
>	[[alternative HTML version deleted]]
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

Sent from my phone. Please excuse my brevity.

More information about the R-help mailing list