[R] convert date/time to numeric

Prof Brian D Ripley ripley at stats.ox.ac.uk
Wed Mar 21 19:38:42 CET 2001


On Wed, 21 Mar 2001, Yu-Ling Wu wrote:

> I convert a numeric value to date/time format and do
> some operations on it. How to convert it back to a
> numeric value?

That's not numeric, that is character when you convert it.  Use the help
system to find how: it's on the same help page as strptime!

> begin <- 200103131030
> EndTime <- strptime(paste(begin), format="%Y%m%d%H%M")
> + 60
> end <- ????
>
> (I want end=200103131031 instead of "2001-03-13
> 10:31:00")

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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