RE: time, calendar, datetime, etc

Discussion in 'Python' started by Tim Peters, Aug 2, 2003.

  1. Tim Peters

    Tim Peters Guest

    [Andrew Dalke]
    > ...
    > The datetime module needs a 0 point (the creation of the universe
    > being rather long ago and the exact time not well known). Given the
    > questions of "when is year 0?" in different calendar systems, it's easy
    > for me to understand why Jan. 1st, 1AD is a good starting point.
    > (Easier than Jan 1st, 1970 - I prefered the Mac's epoch of 1900.)


    There was a specific reason for picking "year 1": that makes datetime's
    date ordinals identical to those used in the base proleptic Gregorian
    calendar in Dershowitz and Reingold's highly regarded "Calendrical
    Calculations":

    http://emr.cs.iit.edu/home/reingold/calendar-book/second-edition/

    So people who want umpteen kinds of calendars Guido doesn't care about can
    look up algorithms in that book to do conversion to and from datetime's view
    of reality. For that reason alone, it was a better choice than most. In
    addition, since an explicit goal of datetime was fast extraction of fields,
    we simply store the year as given (e.g., 2003 is stored as 2003). This also
    works well for fast comparisons. Something missed in this discussion so far
    is that commercial applications deal in countless thousands of dates and
    datetimes -- formatting, sorting and indexing speed are important to them.
    Important enough to Zope Corp to pay the substantial bill for developing
    this code, anyway.

    i-hear-guido-doesn't-come-cheap-ly y'rs - tim
     
    Tim Peters, Aug 2, 2003
    #1
    1. Advertising

  2. Tim Peters

    John Baxter Guest

    In article <>,
    "Tim Peters" <> wrote:

    > [Andrew Dalke]
    > > ...
    > > The datetime module needs a 0 point (the creation of the universe
    > > being rather long ago and the exact time not well known). Given the
    > > questions of "when is year 0?" in different calendar systems, it's easy
    > > for me to understand why Jan. 1st, 1AD is a good starting point.
    > > (Easier than Jan 1st, 1970 - I prefered the Mac's epoch of 1900.)


    1904 for Mac, actually. The story is fairly well documented, but...
    It was desired to include the entire team's set of birth dates
    That didn't get back to 1904, but it got reasonably close to 1900
    1900 was rejected because they didn't want to start out in a leap
    year exception
    They did want to start in a leap year...hence 1904

    The 1904 choice has meant that considered as a signed 32-bit number,
    Macintosh time has always been negative. "Always" in the sense of when
    there were Macintosh machines...the sign change was sometime in 1972, I
    think. And since Pascal was the base higher level language, time was
    indeed negative. (Macintosh time became signed 64 bits--with 32-bit
    clock hardware--around 1991: plenty early to beat the End of Time early
    in 2040.)

    --John (steadfastly ignoring leap seconds)
     
    John Baxter, Aug 2, 2003
    #2
    1. Advertising

  3. Tim Peters fed this fish to the penguins on Friday 01 August 2003 07:30
    pm:

    > Gregorian calendar in Dershowitz and Reingold's highly regarded
    > "Calendrical Calculations":
    >
    > http://emr.cs.iit.edu/home/reingold/calendar-book/second-edition/
    >
    > So people who want umpteen kinds of calendars Guido doesn't care about
    > can look up algorithms in that book to do conversion to and from
    > datetime's view


    Pity the book uses LISP (at least, the first edition did)... Even
    BASIC would be more accessible to most folks <G> (though I would prefer
    a modern BASIC over G-whiz or older).


    --
    > ============================================================== <
    > | Wulfraed Dennis Lee Bieber KD6MOG <
    > | Bestiaria Support Staff <
    > ============================================================== <
    > Bestiaria Home Page: http://www.beastie.dm.net/ <
    > Home Page: http://www.dm.net/~wulfraed/ <
     
    Dennis Lee Bieber, Aug 3, 2003
    #3
  4. Tim Peters

    John Roth Guest

    "Dennis Lee Bieber" <> wrote in message
    news:...
    > Tim Peters fed this fish to the penguins on Friday 01 August 2003 07:30
    > pm:
    >
    > > Gregorian calendar in Dershowitz and Reingold's highly regarded
    > > "Calendrical Calculations":
    > >
    > > http://emr.cs.iit.edu/home/reingold/calendar-book/second-edition/
    > >
    > > So people who want umpteen kinds of calendars Guido doesn't care about
    > > can look up algorithms in that book to do conversion to and from
    > > datetime's view

    >
    > Pity the book uses LISP (at least, the first edition did)... Even
    > BASIC would be more accessible to most folks <G> (though I would prefer
    > a modern BASIC over G-whiz or older).


    That's the version I have (somewhere.) As I've said a couple of times,
    it's not the lack of built-in support for all kinds of strange calendars
    that's
    the problem: it's the decision to limit the time span to 1AD.

    John Roth
    >
    >
    > --
    > > ============================================================== <
    > > | Wulfraed Dennis Lee Bieber KD6MOG <
    > > | Bestiaria Support Staff <
    > > ============================================================== <
    > > Bestiaria Home Page: http://www.beastie.dm.net/ <
    > > Home Page: http://www.dm.net/~wulfraed/ <

    >
     
    John Roth, Aug 3, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben S
    Replies:
    16
    Views:
    739
    John Roth
    Aug 4, 2003
  2. Ben S
    Replies:
    2
    Views:
    315
    Steven Taschuk
    Aug 1, 2003
  3. Tim Peters

    RE: time, calendar, datetime, etc

    Tim Peters, Aug 3, 2003, in forum: Python
    Replies:
    3
    Views:
    364
    John Baxter
    Aug 5, 2003
  4. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    711
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  5. Tim Peters
    Replies:
    0
    Views:
    537
    Tim Peters
    Sep 9, 2003
Loading...

Share This Page