Portable general timestamp format, not 2038-limited

James Harris james.harris.1 at googlemail.com
Thu Jul 5 16:07:55 EDT 2007


On 5 Jul, 08:46, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
> On Wed, 04 Jul 2007 22:12:46 -0400, Roy Smith <r... at panix.com> declaimed
> the following in comp.lang.python:
>
> > Astronomers use Julian Date (http://en.wikipedia.org/wiki/Julian_date) for
> > calculations like this.  It's a widely used format and highly portable.  
> > I'm sure there are libraries to deal with it in all the languages you
> > mention (and more).  Ask on sci.astro for more information.
>
>         <playing devils advocate> But do you also need to account for
> Besselian or Julian centuries (Astronomy used to use B1900 as a
> computational epoch, but now uses J2000. A Julian century is 36525 days,
> Besselian century was 36524.22 days.

Whew! It was for reasons such as this that I suggested treating a day
(i.e. a /nominal/ 24-hour period) as the primary unit. The Gregorian
switch to Julian, for example, missed out a bunch of days to adjust
the calendars of Christendom but they had to be whole numbers of days.
In terms of real people (about the level I need) once a dividing line
has been chosen between one day and the next it becomes a reference
point.

Incidentally I have chosen to store /average/ values in the
application so if the sample period is 10 seconds and the count
increases by 45 I will store 4.5. This is plottable directly and I
could even allow an 11 second sample when a leap second is added (if I
needed that detail).

Is your Julian century a bit long, on average, 2000, 2400, 2800 etc
having 28 days in Feb?




More information about the Python-list mailing list