Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NormalDate 1.2 released

1 view
Skip to first unread message

Jeff Bauer

unread,
Mar 11, 2002, 5:42:35 PM3/11/02
to
NormalDate 1.2 is available from:

http://starship.python.net/crew/jbauer/normaldate/

NormalDate is a specialized class to handle dates without
all the excess baggage (time zones, daylight savings, leap
seconds, etc.) of other date structures. The minimalist
strategy greatly simplifies its implementation and use.

NormalDate is a pure Python class and is therefore
portable to Jython, Windows CE devices, etc. It has
been in use in one form or another by many users,
judging from email, since 1997.

The 1.2 release includes an important bugfix for Python 2.2.

Jeff Bauer
Rubicon Research

John Machin

unread,
Mar 11, 2002, 10:07:24 PM3/11/02
to
Jeff Bauer <jba...@rubic.com> wrote in message news:<mailman.1015887440...@python.org>...

> NormalDate 1.2 is available from:
>
> http://starship.python.net/crew/jbauer/normaldate/
>

I was curious to find the magic number 1582 in the source code, in a
method where it is testing for a valid date:

if year == 1582 and month == 10 and day > 4 and day < 15:
return 0 # special case of 10 days dropped: Oct 5-14, 1582

To make some sense of reported historical dates, one needs to guess
based on the location, origin and mind-set of the reporter. The
introduction of the Gregorian calendar was spread over 1582-1587 in
Roman-Catholic-influenced regions, 1700-1701 in some
Protestant-influenced regions and 1752-1753 in others (including
England and its then colonies) -- and that's just some of Europe.
Greece didn't change until 1924. Germany, the Netherlands, and
Switzerland split along religious lines into the 1582+ group and the
1700+ group. Alaska changed in 1867 upon purchase from Russia -- the
then USSR changed in 1918; make your own deductions about other states
like Louisiana and Texas. There's even a story that the date of
introduction in Sweden varied by parish!

Not all the countries that changed in 1582 omitted the same range of
dates.

The warp in the calendar that is used by the above code is only
correct (under some limited definition of "correct") for the areas
then defined as part of Rome, Italy, Portugal, Spain & Poland.

Andrew Dalke

unread,
Mar 12, 2002, 2:59:01 AM3/12/02
to
John Machin:

>To make some sense of reported historical dates, one needs to guess
>based on the location, origin and mind-set of the reporter.

I always figured time code should use the parameters "latitude",
"longitude", and "attitude" (which rhymes better than religion :)

Andrew
da...@dalkescientific.com

Duncan Booth

unread,
Mar 12, 2002, 4:24:16 AM3/12/02
to
sjma...@lexicon.net (John Machin) wrote in
news:c76ff6fc.02031...@posting.google.com:

> There's even a story that the date of
> introduction in Sweden varied by parish!

Dont forget that Sweden even had a 30th February one year!

--
Duncan Booth dun...@rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?

Skip Montanaro

unread,
Mar 12, 2002, 6:08:14 PM3/12/02
to

[... 13 X 28 + 1 or 2 ...]
Timothy> Why was this simple system never adopted?

As someone else said earlier in this thread, "latitude, longitude, attitude
(aka religion)".

S

Delaney, Timothy

unread,
Mar 12, 2002, 5:56:51 PM3/12/02
to
> From: Duncan Booth [mailto:dun...@NOSPAMrcp.co.uk]

>
> sjma...@lexicon.net (John Machin) wrote in
>
> > There's even a story that the date of
> > introduction in Sweden varied by parish!
>
> Dont forget that Sweden even had a 30th February one year!

All calendars are ridiculous. It should be very simple ...

13 x 28 day (4 week) months = 364 days.

1 "extra" day (new year?)
1 additional day in leap years.

The extra days can be used to absorb leap seconds, etc.

You can also define that each month begins on a particular day of the week
(say Sunday). The extra days of the year do not actually have a day of the
week, and would always be between Saturday and Sunday.

IIRC this is the system that the shire hobbits used.

Why was this simple system never adopted?

Tim Delaney

Peter Hansen

unread,
Mar 12, 2002, 7:38:11 PM3/12/02
to
"Delaney, Timothy" wrote:
>
> 13 x 28 day (4 week) months = 364 days.
[...]

> IIRC this is the system that the shire hobbits used.
>
> Why was this simple system never adopted?

I'm pretty sure it's because the hobbits were all wiped
out after Sauron rose again and conquered Middle Earth,
imposing the Unified Mordorian Calendar system across
much of the planet until the changes made by Pope Gregory
in 1582.

-Peter

Sven Axelsson

unread,
Mar 13, 2002, 7:21:21 AM3/13/02
to
Duncan Booth <dun...@NOSPAMrcp.co.uk> wrote in
news:Xns91CF5F8D7A3...@127.0.0.1:

> sjma...@lexicon.net (John Machin) wrote in
> news:c76ff6fc.02031...@posting.google.com:
>
>> There's even a story that the date of
>> introduction in Sweden varied by parish!
>
> Dont forget that Sweden even had a 30th February one year!
>

Yes, the story is really strange. Sweden decided to make a gradual change
from the Julian to the Gregorian calendar. By dropping every leap year
from 1700 through 1740 the eleven superfluous days would be omitted and
from 1 Mar 1740 they would be in sync with the Gregorian calendar. (But
in the meantime they would be in sync with nobody!)

So 1700 (which should have been a leap year in the Julian calendar) was
not a leap year in Sweden. However, by mistake 1704 and 1708 became leap
years. This left Sweden out of synchronisation with both the Julian and
the Gregorian world, so they decided to go back to the Julian calendar.
In order to do this, they inserted an extra day in 1712, making that year
a double leap year! So in 1712, February had 30 days in Sweden.

Later, in 1753, Sweden changed to the Gregorian calendar by dropping 11
days like everyone else.


--
Sven Axelsson, Bok & webb
sven.NO....@bokochSPAMwebb.se

Brandon Craig Rhodes

unread,
Mar 24, 2002, 3:43:50 PM3/24/02
to
"Delaney, Timothy" <tdel...@avaya.com> writes:

> All calendars are ridiculous. It should be very simple ...
>
> 13 x 28 day (4 week) months = 364 days.
>
> 1 "extra" day (new year?)
> 1 additional day in leap years.
>

> IIRC this is the system that the shire hobbits used.

Not quite; the Shire calendar involved:

12 months of 30 days = 360 days
2 days of Yule (between December and January)
3 days of Lithe (between June and July)
+ the Overlithe, added to the Lithedays in leap-years

More details and a rather attractive chart can be found at:

http://www.shire-reckoning.com/calendar.html

> Why was this simple system never adopted?

Habit.

--
Brandon Craig Rhodes http://www.rhodesmill.org/brandon
Georgia Tech Research Institute bra...@rhodesmill.org

0 new messages