summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix probable bug; if errno == EINTR, floatsleep() doesn't break out ofAndrew M. Kuchling2000-03-241-1/+1
| | | | | | | a Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS block, but it calls Py_BLOCK_THREADS anyway. The change moves Py_BLOCK_THREADS to inside the if, so it's only executed when the function actually returns unexpectedly.
* Fix bogus error reporting on strptime: let PyArg_ParseTuple set exception.Jeremy Hylton2000-03-141-5/+4
| | | | Also, wrap long line.
* Massive patch by Skip Montanaro to add ":name" to as manyGuido van Rossum2000-02-291-4/+4
| | | | PyArg_ParseTuple() format string arguments as possible.
* The functions asctime() and mktime() are documented to take a 9-tupleGuido van Rossum2000-01-121-4/+10
| | | | | | only. Through some mysterious interaction, they would take 9 separate arguments as well. This misfeature is now disabled (to end a difference with JPython).
* Jack Jansen: Mac has no EINTR.Guido van Rossum1999-11-081-0/+4
|
* In floatsleep(), when using select(), ignore EINTR error.Guido van Rossum1999-08-191-2/+4
|
* Apparently __GNU_LIBRARY__ is defined for glibc as well as for libc5.Guido van Rossum1999-04-231-3/+3
| | | | | | | The test really wanted to distinguish between the two. So now we test for __GLIBC__ instead. I have confirmed that this works for glibc and I have an email from Christian Tanzer confirming that it works for libc5, so it should be fine.
* Jonathan Giddy notes, and Chris Lawrence agrees, that some comments onGuido van Rossum1999-04-051-3/+3
| | | | #else/#endif are wrong, and that #if HAVE_TM_ZONE should be #ifdef.
* #$@%! Forgot to remove a #error directive used for testing. Sorry.Guido van Rossum1999-03-291-1/+0
|
* Chris Lawrence writes:Guido van Rossum1999-03-291-18/+28
| | | | | | | | | | | | | | | | | | | | | | """ The GNU folks, in their infinite wisdom, have decided not to implement altzone in libc6; this would not be horrible, except that timezone (which is implemented) includes the current DST setting (i.e. timezone for Central is 18000 in summer and 21600 in winter). So Python's timezone and altzone variables aren't set correctly during DST. Here's a patch relative to 1.5.2b2 that (a) makes timezone and altzone show the "right" thing on Linux (by using the tm_gmtoff stuff available in BSD, which is how the GLIBC manual claims things should be done) and (b) should cope with the southern hemisphere. In pursuit of (b), I also took the liberty of renaming the "summer" and "winter" variables to "july" and "jan". This patch should also make certain time calculations on Linux actually work right (like the tz-aware functions in the rfc822 module). (It's hard to find DST that's currently being used in the southern hemisphere; I tested using Africa/Windhoek.) """
* Patch by Chris Herborth for BeOS code.Guido van Rossum1999-03-091-14/+8
| | | | | | | | | | He writes: I had an off-by-1000 error in floatsleep(), and the problem with time.clock() is that it's not implemented properly on QNX... ANSI says it's supposed to return _CPU_ time used by the process, but on QNX it returns the amount of real time used... so I was confused.
* Patch by Tadayoshi Funaba (with some changes) to be smarter aboutGuido van Rossum1999-02-231-6/+12
| | | | | | | | guessing what happened when strftime() returns 0. Is it buffer overflow or was the result simply 0 bytes long? (This happens for an empty format string, or when the format string is a single %Z and the timezone is unknown.) if the buffer is at least 256 times as long as the format, assume the latter.
* We don't support leap seconds, so the seconds field of a time 9-tupleGuido van Rossum1999-02-221-1/+1
| | | | should be in the range [0-59]. Noted by Tadayoshi Funaba.
* The doc string for strptime had the arguments reversed -- the stringGuido van Rossum1999-01-071-1/+1
| | | | comes first, the format second! Scott Cotton discovered this.
* Get rid of the strptype() declaration -- on some BSD systems, it's aGuido van Rossum1999-01-031-1/+1
| | | | | conflict, and it should be declared in time.h anyway. (Too bad if gcc -Wall won't be happy if it isn't declared...)
* Add DL_EXPORT() to all modules that could possibly be usedGuido van Rossum1998-12-041-1/+1
| | | | on BeOS or Windows.
* Make gcc -Wall happy:Guido van Rossum1998-10-071-6/+8
| | | | | (1) add dummy decl for strptime(); (2) move the code to set accept2dyear to the front of inittime().
* Fixes for OS/2 by Jeff Rush.Guido van Rossum1998-09-281-9/+9
|
* Y2K fix affecting asctime(), mktime(), strftime().Guido van Rossum1998-08-251-19/+37
| | | | | | | | | | | | | | | | 2-digit years are now converted using rules that are (according to Fredrik Lundh) recommended by POSIX or X/Open: 0-68 mean 2000-2068, 69-99 mean 1969-1999. 2-digit years are now only accepted if time.accept2dyear is set to a nonzero integer; if it is zero or not an integer or absent, only year values >= 1900 are accepted. Year values 100-1899 and negative year values are never accepted. The initial value of time.accept2dyear depends on the environment variable PYTHONY2K: if PYTHONY2K is set and non-empty, time.accept2dyear is initialized to 0; if PYTHONY2K is empty or not set, time.accept2dyear is initialized to 0.
* Changes for BeOS, QNX and long long, by Chris Herborth.Guido van Rossum1998-08-041-4/+38
|
* Added doc strings.Guido van Rossum1998-06-271-11/+114
|
* Added strptime, if it exists. Modified after a patch by Jesse Hallio.Guido van Rossum1998-06-091-10/+53
|
* Instead of calling mktime(), which has all sorts of unwanted sideGuido van Rossum1998-04-271-6/+2
| | | | | effects, simply zero out the struct tm buffer before using it; this should take care of the BSD folks' concern just as well.
* Check for HAVE_MKTIME (if you don't have it, some tests will fail, butGuido van Rossum1998-03-061-0/+9
| | | | at least the build will now succeed). For Sony NEWS-OS, BSD 4.3 based.
* Raise ValueError: "unconvertible time" when ctime() returns NULL,Guido van Rossum1998-03-031-0/+4
| | | | instead of dumping core.
* At Jeff Rush' request, add Py_BEGIN/END_ALLOW_THREADS around call toGuido van Rossum1997-12-291-0/+3
| | | | DosSleep().
* (1) call mktime() just before strftime(); it normalizes the buffer andGuido van Rossum1997-12-081-0/+8
| | | | | | may set the timezone name for BSD systems... (2) fake all of the timezone variables for the mac.
* Patch for QNX, by Chris Herborth.Guido van Rossum1997-12-021-5/+5
|
* os2 patch by Jeff RushGuido van Rossum1997-11-221-1/+21
|
* Move the Py_{{BEGIN,END}_ALLOW,BLOCK}_THREADS macros in time_sleep()Guido van Rossum1997-11-031-7/+15
| | | | | | to inside floatsleep(). This is necessary because floatsleep() does the error handling and it must have grabbed the interpreter lock and thread state before it can do so.
* timezone support for macintosh (Jack)Guido van Rossum1997-10-081-0/+36
|
* Win32 precision clock() -- Mark Hammond.Guido van Rossum1997-04-021-1/+44
|
* Issue a more meaningful error if strftime keeps returning a NULL pointer.Guido van Rossum1997-02-141-2/+5
| | | | Run the loop up to and including 8k.
* Formatting, and minor error detectionBarry Warsaw1997-01-131-49/+52
|
* Added #ifdef around ``extern int ftime();'' for MS WINDOWS (which hasGuido van Rossum1996-12-091-2/+4
| | | | | a conflicting definition somewhere). Resolved line wrap for error message in ins().
* ins(): missed a renaming in a string: dictinsert =>Barry Warsaw1996-12-091-1/+1
| | | | | | PyDict_SetItemString. GvR: note the long line > 80 chars. Wrapping suggestions?
* Greatly renamed.Barry Warsaw1996-12-061-86/+88
|
* Add extern decl of ftime() to make gcc -Wall happy.Guido van Rossum1996-12-061-0/+1
|
* Should compare errno to 0, not NULLGuido van Rossum1996-11-021-1/+1
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Check for NULL pointer returned from localtime()/gmtime().Guido van Rossum1996-10-081-1/+10
|
* Sleep() turns out to be win32 specific.Guido van Rossum1996-09-071-7/+6
| | | | | The timezone etc. overrides are win16 specific. Hope I got this right now...
* Some changes for better Windows portability.Guido van Rossum1996-09-061-7/+11
|
* Include "mymath.h" instead of manually declaring math functions.Guido van Rossum1996-08-081-2/+4
|
* Watcom changes.Guido van Rossum1996-05-231-1/+18
| | | | | Add mktime() overflow test and make it NeXT robust by initializing the structure from localtime().
* default CLOCKS_PER_SEC to CLK_TCK if it existsGuido van Rossum1996-02-251-0/+4
|
* mark strftime as varargsGuido van Rossum1996-02-131-1/+1
|
* Removed unused variableJack Jansen1995-10-031-1/+1
|
* added time.strftime()Guido van Rossum1995-09-131-0/+50
|
* tiny additions for Windows 3.1Guido van Rossum1995-03-141-0/+3
|