summaryrefslogtreecommitdiffstats
path: root/Modules/datetimemodule.c
Commit message (Collapse)AuthorAgeFilesLines
* call_utc_tzinfo_method(): Got rid of the label and the gotos.Tim Peters2002-12-231-7/+2
|
* I give up: unless I write my own strftime by hand, datetime just can'tTim Peters2002-12-221-0/+25
| | | | | | be trusted with years before 1900, so now we raise ValueError if a date or datetime or datetimetz .strftime() method is called with a year before 1900.
* Python's strftime implementation does strange things with the year,Tim Peters2002-12-221-1/+5
| | | | | | | | | | such that the datetime tests failed if the envar PYTHON2K was set. This is an utter mess, and the datetime module's strftime functions inherit it. I suspect that, regardless of the PYTHON2K setting, and regardless of platform limitations, the datetime strftime wrappers will end up delivering nonsense results (or bogus exceptions) for any year before 1900. I should probably just refuse to accept years earlier than that -- else we'll have to implement strftime() by hand.
* classify_object(): Renamed more meaningfully, to classify_utcoffset().Tim Peters2002-12-221-20/+17
| | | | | Also changed logic so that instances of user-defined subclasses of date, time, and datetime are called OFFSET_NAIVE instead of OFFSET_UNKNOWN.
* Implemented a Wiki suggestion:Tim Peters2002-12-221-76/+123
| | | | | | | | | | | | {timetz,datetimetz}.{utcoffset,dst}() now return a timedelta (or None) instead of an int (or None). tzinfo.{utcoffset,dst)() can now return a timedelta (or an int, or None). Curiously, this was much easier to do in the C implementation than in the Python implementation (which lives in the Zope3 code tree) -- the C code already had lots of hair to extract C ints from offset objects, and used C ints internally.
* format_utcoffset(): The natural type of the buflen arg is size_t, soTim Peters2002-12-201-10/+8
| | | | | | | | | | used that. wrap_strftime(): Removed the most irritating uses of buf. TestDate.test_ordinal_conversions(): The C implementation is fast enough that we can afford to check the endpoints of every year. Also added tm_yday tests at the endpoints.
* Fix another long vs int mismatch. test_datetime now passes on alphaNeal Norwitz2002-12-191-3/+3
|
* Fixed typo in string.Tim Peters2002-12-191-5/+20
|
* Fix crash on alphas due to mismatch between 'l' format and int variables.Neal Norwitz2002-12-191-1/+1
|
* delta_str(): Purged last uses of sprintf (in favor of PyOS_snprintf).Tim Peters2002-12-181-10/+25
|
* "time_second" is apparently a #define on MacOSX. Renamed the (static)Jack Jansen2002-12-171-2/+2
| | | | routine to py_time_second.
* Fix GCC warnings. It turns out two out of three pointed to real bugs!Guido van Rossum2002-12-161-3/+3
|
* datetime escapes the sandbox. The Windows build is all set. I leave itTim Peters2002-12-161-0/+5075
to others to argue about how to build it on other platforms (on Windows it's in its own DLL).