[R] How to convert timestamps?

jim holtman jholtman at gmail.com
Fri Jan 29 10:54:06 CET 2010


Is this what you want:

> x
 [1] 1225221868 1225221906 1225221906 1225230997 1225231000 1225231003
1225231152 1225231348 1225231351
[10] 1225231400
> as.POSIXct(x,origin='1970-1-1',tz='GMT')
 [1] "2008-10-28 19:24:28 GMT" "2008-10-28 19:25:06 GMT" "2008-10-28
19:25:06 GMT"
 [4] "2008-10-28 21:56:37 GMT" "2008-10-28 21:56:40 GMT" "2008-10-28
21:56:43 GMT"
 [7] "2008-10-28 21:59:12 GMT" "2008-10-28 22:02:28 GMT" "2008-10-28
22:02:31 GMT"
[10] "2008-10-28 22:03:20 GMT"
>


On Fri, Jan 29, 2010 at 2:24 AM, johannes rara <johannesraja at gmail.com> wrote:
> I have timestamps from mysql database:
>
>> dput(tstamp)
> c(1225221868L, 1225221906L, 1225221906L, 1225230997L, 1225231000L,
> 1225231003L, 1225231152L, 1225231348L, 1225231351L, 1225231400L
> )
>
> How to convert these into normal dates?
>
> Thanks,
> jrara
>
> ______________________________________________
> 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list