Millisecond clock resolution for DateAndTime now
Bruce O'Neel
edoneel at sdf.lonestar.org
Mon Sep 27 12:03:18 UTC 2004
Hi,
For those who care the leap second table is at ftp://maia.usno.navy.mil/ser7/tai-utc.dat
and the contents are:
1961 JAN 1 =JD 2437300.5 TAI-UTC= 1.4228180 S + (MJD - 37300.) X 0.001296 S
1961 AUG 1 =JD 2437512.5 TAI-UTC= 1.3728180 S + (MJD - 37300.) X 0.001296 S
1962 JAN 1 =JD 2437665.5 TAI-UTC= 1.8458580 S + (MJD - 37665.) X 0.0011232S
1963 NOV 1 =JD 2438334.5 TAI-UTC= 1.9458580 S + (MJD - 37665.) X 0.0011232S
1964 JAN 1 =JD 2438395.5 TAI-UTC= 3.2401300 S + (MJD - 38761.) X 0.001296 S
1964 APR 1 =JD 2438486.5 TAI-UTC= 3.3401300 S + (MJD - 38761.) X 0.001296 S
1964 SEP 1 =JD 2438639.5 TAI-UTC= 3.4401300 S + (MJD - 38761.) X 0.001296 S
1965 JAN 1 =JD 2438761.5 TAI-UTC= 3.5401300 S + (MJD - 38761.) X 0.001296 S
1965 MAR 1 =JD 2438820.5 TAI-UTC= 3.6401300 S + (MJD - 38761.) X 0.001296 S
1965 JUL 1 =JD 2438942.5 TAI-UTC= 3.7401300 S + (MJD - 38761.) X 0.001296 S
1965 SEP 1 =JD 2439004.5 TAI-UTC= 3.8401300 S + (MJD - 38761.) X 0.001296 S
1966 JAN 1 =JD 2439126.5 TAI-UTC= 4.3131700 S + (MJD - 39126.) X 0.002592 S
1968 FEB 1 =JD 2439887.5 TAI-UTC= 4.2131700 S + (MJD - 39126.) X 0.002592 S
1972 JAN 1 =JD 2441317.5 TAI-UTC= 10.0 S + (MJD - 41317.) X 0.0 S
1972 JUL 1 =JD 2441499.5 TAI-UTC= 11.0 S + (MJD - 41317.) X 0.0 S
1973 JAN 1 =JD 2441683.5 TAI-UTC= 12.0 S + (MJD - 41317.) X 0.0 S
1974 JAN 1 =JD 2442048.5 TAI-UTC= 13.0 S + (MJD - 41317.) X 0.0 S
1975 JAN 1 =JD 2442413.5 TAI-UTC= 14.0 S + (MJD - 41317.) X 0.0 S
1976 JAN 1 =JD 2442778.5 TAI-UTC= 15.0 S + (MJD - 41317.) X 0.0 S
1977 JAN 1 =JD 2443144.5 TAI-UTC= 16.0 S + (MJD - 41317.) X 0.0 S
1978 JAN 1 =JD 2443509.5 TAI-UTC= 17.0 S + (MJD - 41317.) X 0.0 S
1979 JAN 1 =JD 2443874.5 TAI-UTC= 18.0 S + (MJD - 41317.) X 0.0 S
1980 JAN 1 =JD 2444239.5 TAI-UTC= 19.0 S + (MJD - 41317.) X 0.0 S
1981 JUL 1 =JD 2444786.5 TAI-UTC= 20.0 S + (MJD - 41317.) X 0.0 S
1982 JUL 1 =JD 2445151.5 TAI-UTC= 21.0 S + (MJD - 41317.) X 0.0 S
1983 JUL 1 =JD 2445516.5 TAI-UTC= 22.0 S + (MJD - 41317.) X 0.0 S
1985 JUL 1 =JD 2446247.5 TAI-UTC= 23.0 S + (MJD - 41317.) X 0.0 S
1988 JAN 1 =JD 2447161.5 TAI-UTC= 24.0 S + (MJD - 41317.) X 0.0 S
1990 JAN 1 =JD 2447892.5 TAI-UTC= 25.0 S + (MJD - 41317.) X 0.0 S
1991 JAN 1 =JD 2448257.5 TAI-UTC= 26.0 S + (MJD - 41317.) X 0.0 S
1992 JUL 1 =JD 2448804.5 TAI-UTC= 27.0 S + (MJD - 41317.) X 0.0 S
1993 JUL 1 =JD 2449169.5 TAI-UTC= 28.0 S + (MJD - 41317.) X 0.0 S
1994 JUL 1 =JD 2449534.5 TAI-UTC= 29.0 S + (MJD - 41317.) X 0.0 S
1996 JAN 1 =JD 2450083.5 TAI-UTC= 30.0 S + (MJD - 41317.) X 0.0 S
1997 JUL 1 =JD 2450630.5 TAI-UTC= 31.0 S + (MJD - 41317.) X 0.0 S
1999 JAN 1 =JD 2451179.5 TAI-UTC= 32.0 S + (MJD - 41317.) X 0.0 S
Remeber that julian days start at noon (hey, it makes sense if you are a
European astronomer) so JD 2451179.5 is midnight.
cheers
bruce
On Sun, Sep 26, 2004 at 09:50:49PM -0400, David T. Lewis wrote:
> On Sun, Sep 26, 2004 at 03:58:43PM -0700, Tim Rowledge wrote:
> > "David T. Lewis" <lewis at mail.msen.com> wrote:
> >
> > [snip]
> > > That's exactly what Lex is suggesting.
> >
> > That might be what he meant but it isn't what he wrote... I quote...
> > >> . The time, probably as approximately[1] the number of seconds since
> > > > some epoch.
>
> Tim,
>
> Obviously you have been lulled into a false sense of security by the
> media. The world is a wobbly place, full of uncertainty and all manner
> of imprecision.
>
> Having paid quite close attention to these matters, I count no fewer
> than 22 leap seconds that have occurred since Jan 1, 1970 UTC. Some
> of these cosmic recalibrations may have entirely escaped the notice
> of the less attentive among us, accounting for a general uncertainty
> as to where any of us really stands on the cosmic timeline. Small wonder
> if Lex may have felt a bit off center with regard to time primitives; it
> happens to all of us with advancing age. You really aught to be more
> sensitive about these things.
>
> > Whereas I meant filling in an array of
> > int tm_sec;
> > int tm_min;
> > int tm_hour;
> > int tm_mday;
> > int tm_mon;
> > int tm_year;
> > int tm_wday;
> > int tm_yday;
> > int tm_isdst;
>
> Well then, that's a horse of a different color. It's easy to be precise
> if one squints one's eyes and focuses only on the present.
> ;-)
>
> > Or whatever is suitable to the typical call. The above is RISC OS's
> > gmtime() equivalent. I'd need to find the DST offset as well I guess.
>
> gmtime() has precision to the nearest second. Does RISC OS provide a
> gettimeofday() function? This is a BSD function that answers time to
> millisecond precision, and also provides the time zone offset and a
> flag denoting daylight savings time. If this or something like it is
> available on RISC OS, then it should be possible to implement Lex's
> suggestion on all the major Squeak platforms.
>
> Dave
>
>
--
edoneel at sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org
More information about the Squeak-dev
mailing list
|