[R] From time-strings to Unix-Epoche-time?

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Sep 12 15:51:42 CEST 2008


On Fri, 12 Sep 2008, Oliver Bandel wrote:

> Hello,
>
>
> I have strings with date-/time-data from a logfile.
>
> For a sort-by-time (and other time-related analysis)
> I need something to convert the
> times to the Unix-epoche-time (better also with parts
> of seconds).
>
> Is there something that does that job (or a similar conversion)
> in R?

as.numeric, unsurprisingly, for class  "POSIXct" (and as.POSIXct if 
needed ...).  It can be to sub-second accuracy (use %OS to read such 
fields).

-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list