TimeSpan

As I understand it python datetime has a limited date range (MINYEAR=1 and MAXYEAR=9999) so the python datetime is not an option.
In the sample code you will get an ValueError Exception if you use python datetime.
Roger Lindberg

I have to ask: why do you need to know the number of milliseconds in 120,000 years?

Such a calculation would almost certainly be wrong in any case due
to leap seconds,

···

On 13/04/13 17:08, C M wrote:

  I have to ask:  why do you need to know the number of

milliseconds in 120,000 years?

  --

  You received this message because you are subscribed to the Google

Groups “wxPython-users” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to .
For more options, visit .
https://en.wikipedia.org/wiki/Leap_second
https://en.wikipedia.org/wiki/Gregorian_calendar#Adoption


Steve Gadget Barnes

wxpython-users+unsubscribe@googlegroups.com
https://groups.google.com/groups/opt_out

I haven't seen any doc that describe the limitations in the TimeSpan class so in my oppinion it should work for any valid dates. Any overflow within the TimeSpan object ought to result in an exception. How can you otherwise know that the TimeSpan object delivers valid data?
Roger Lindberg

Roger Lindberg wrote:

I haven't seen any doc that describe the limitations in the TimeSpan class so in my oppinion it should work for any valid dates. Any overflow within the TimeSpan object ought to result in an exception. How can you otherwise know that the TimeSpan object delivers valid data?

Your position is not unreasonable. It's clear that the 49-day
limitation on milliseconds is a bug in the wxPython wrapper that does
not exist in the underlying C++ code. The 4000-year limitation appears
to be more fundamental.

On a more philosophical note, the fact that the wxDateTime class worries
about time zones and daylight savings time tells us that it was designed
to work with historical dates and times, not with geological or
astronomical dates and times. And even with that restriction, the
implementation is not complete. For example, wxDateTime fails to handle
the Gregorian calendar gap in either 1582 or 1752, depending on your
country.

So, in my opinion, you should consider the wx date/time classes to be
usable for today plus or minus 250 years. For any other purposes, there
are complicated considerations that the tools do not handle, and you
will have to find different code.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.