[R] handling dates

Thomas Lumley thomas at biostat.washington.edu
Mon May 22 17:44:50 CEST 2000


On Mon, 22 May 2000, Strumila, John wrote:

> howdy R friends,
> 
> Can anyone help me with converting a 'unix' date (seconds since 1970) into
> something readable?
> 
> There doesn't seem to be anything in the 'date' package and the prospect of
> calculating this myself doesn't excite me.

Well, if you take a date and divide by 60*60*24 you have days since the
zero date. You can then add this to the zero date.  

   date<-mdy.date(1,1,1970)+unixdate/(60*60*24)


	-thomas


Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list