Skip to content

calculating seconds

4 messages · Erin Hodgess, Uwe Ligges, Jeff Newmiller +1 more

#
On 19.02.2013 18:52, Erin Hodgess wrote:
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
#
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:

            
#
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}}