[LEAPSECS] [time-nuts] Leap Quirks

Rob Seaman seaman at noao.edu
Mon Jan 5 08:57:37 EST 2009


Magnus Danielson wrote:


> time_t = d*86400 + h*3600 + m*60 + s


Just thought I'd note an alternate interpretation. In NOAO's widely
distributed image processing system (IRAF) a sexagesimal number is a
double precision floating point number, not an integer:

12:34:56 = 12 + 34/60 + 56.0/3600

Wherever a float can appear, a sexagesimal string is permitted. Our
version of printf includes %h and %H for turning a binary float back
into dd:mm:ss.s or hh:mm:ss.s.

A particular application may need to count integer seconds (as in our
own date and time library, perhaps), but the need is remarkably
infrequent. For the vast majority of cases sexagesimal numbers behave
like floats.

Rob Seaman
National Optical Astronomy Observatory


More information about the LEAPSECS mailing list