Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: time manip


From   Christopher F Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re: time manip
Date   Sat, 28 Sep 2002 08:05:22 -0400

--On Saturday, September 28, 2002 2:33 -0400 Jesper wrote:

I agree that it might be nice in some situations to have a format that
specified the exact time as well as the day.


 So, unless you truncate it, the granularity of the timing is in the
daystamp variable.
As proposed, an approximation of the timing to the second is in the daystamp variable. Since the number of seconds since the epoch is a 9 digit number, the proposed calculations should be generated as doubles; otherwise applying this transformation and its inverse will not yield the original timestamp. A second off here, a second off there, and averages or other summary stats based on these calculations will be imprecise.

It would be very useful to have a set of functions that allow you to work directly with the *nix time, which allows for exact arithmetic since it is an integer. I should not have to transform data into fractional days and then back again to do differencing arithmetic (how long, in minutes, between successive doses of the drug?) Those calculations using epoch time are trivial. Then all that is needed is the ability to take a number of seconds and format it as elapsed HH:MM[:SS], as Jesper suggests.

Kit
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index