[R] Convert Unix (Epoch) timestamp to DD/MM/YY and HH:MM:SS

jim holtman jholtman at gmail.com
Tue Jul 20 18:13:30 CEST 2010


Here is a function I use to convert a numeric value of the UNIX time to POSIXct


unix2POSIXct  <-  function (time)   structure(time, class =
c("POSIXt", "POSIXct"))


On Tue, Jul 20, 2010 at 9:26 AM, Jim Hargreaves <james at ipec.co.uk> wrote:
> Dear List,
>
> After much searching with no success, I would like to ask how I can convert
> a unix/POSIX time (seconds since Jan 01, 1970) into a string like
> "01/01/1970 00:00"
>
> This is probably easily done with a system(date...) but it would be great if
> I could do it in R.
>
> Kind Regards,
> Jim Hargreaves
>
> ______________________________________________
> 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