[R] time conversion from second to Y M D H M S format

R. Michael Weylandt michael.weylandt at gmail.com
Thu Feb 2 19:23:47 CET 2012


It works for me as well so there's something funny on your end: please
run the following *verbatim* (in a vanilla R session):

sink("ForRHelp.txt")
print(sessionInfo())
cat("\n")
print(.Platform)
time <-as.POSIXct(c( 126230400, 126252000, 126273600),
origin="2005-01-01", tz="GMT")
print(time)
cat(format(time[1], "%Y %m %d %H %M %S"), "\n")
cat(format(time[2], "%Y %m %d %H %M %S"), "\n")
cat(format(time[3], "%Y %m %d %H %M %S"), "\n")
sink()
print(paste("Text file in", getwd()))

and send the resulting txt file to the list (so we can see exactly
your system config and what not).

Michael


On Thu, Feb 2, 2012 at 11:57 AM, uday <uday_143_4u at hotmail.com> wrote:
> Dear Uwe ,
> Thanks for reply
> I have tried format function that u suggested (format(time_t1, "%Y %m %d %H
> %M %S")  and I got
> format(time_t1, "%Y %m %d %H %M %S")
> [1] "126230400" "126252000" "126273600" "126295200" "126316800" "126338400"
>
>
> I think something  is not working correct.
>
>
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/time-conversion-from-second-to-Y-M-D-H-M-S-format-tp4350831p4352062.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.



More information about the R-help mailing list