Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.WNT.4.31.0103211833370.240-100000@tern.stats>
Date: 2001-03-21T18:38:42Z
From: Brian Ripley
Subject: convert date/time to numeric
In-Reply-To: <20010321181048.56774.qmail@web11501.mail.yahoo.com>

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