Prof Brian Ripley <[EMAIL PROTECTED]> writes: > On Sat, 14 Jul 2007, Patrick Drechsler wrote: > >> is there an R function to convert unixtime to one of the R time >> formats (using chron or POSIXct)? >> >> Example data: >> >> unixtime year month day hour >> 1183377301 2007 7 2 13 >> >> I would like to only use the first column. > > See ?as.POSIXct, especially its examples. (Isn't that the very obvious > place to look?) > > It seems you want ISOdatetime(1970,1,1,0,0,0) + unixtime > > although depending on the 'unix' in 'unixtime' you might have to wrorry > about leap seconds (which POSIX-compliant systems ignore).
Thank you very much for your reply! Indeed, ISOdatetime was the command I was looking for. Regards Patrick ______________________________________________ [email protected] 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.
