An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130219/c1352715/attachment.pl>
calculating seconds
4 messages · Erin Hodgess, Uwe Ligges, Jeff Newmiller +1 more
On 19.02.2013 18:52, Erin Hodgess wrote:
Dear R People: I'm looking at some data which has the time in seconds since 1992/10/8, 15:15:42.5
Just ask R to
strptime("1992/10/8,15:15:42.5", "%Y/%m/%d,%H:%M:%OS") + NumberOfSeconds
and you get the actual date after the given amount of NumberOfSeconds.
Including correct timezone / daylight saving stuff / leap seconds etc.
Best,
Uwe Ligges
Are there any functions currently available to "translate" this or should I just do my own? I figured that I'd check first. Thanks, Erin
Your subject line says you want to calculate seconds... the body of your message says you want to "translate" seconds (to something unspecified).
I am not sure how we are supposed to respond. Can you give us a short example of what you have and what you want using R syntax?
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Erin Hodgess <erinm.hodgess at gmail.com> wrote:
Dear R People: I'm looking at some data which has the time in seconds since 1992/10/8, 15:15:42.5 Are there any functions currently available to "translate" this or should I just do my own? I figured that I'd check first. Thanks, Erin
I'm looking at some data which has the time in seconds since 1992/10/8, 15:15:42.5 Are there any functions currently available to "translate" this or should I just do my own?
strptime() goes from date formats to seconds.
For going the other way, see ?DateTimeClasses for a lot of information on dates and times, and (probably) ?as.POSIXct for changing something in seconds (as the Examples say, 'a large integer') into a date-time class which you should be able to convert to other things more easily.
S Ellison
*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}