summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Close #10278: Add clock_getres(), clock_gettime() and CLOCK_xxx constants toVictor Stinner2011-10-251-0/+72
| | | | | the time module. time.clock_gettime(time.CLOCK_MONOTONIC) provides a monotonic clock
* Issue #10653: Fix time.strftime() on Windows, check for invalid format stringsVictor Stinner2011-10-161-4/+4
|
* Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-1/+1
|
* (Merge 3.2) Issue #10653: On Windows, use strftime() instead of wcsftime()Victor Stinner2011-10-141-0/+5
|\ | | | | | | because wcsftime() doesn't format time zone correctly.
| * Issue #10653: On Windows, use strftime() instead of wcsftime() becauseVictor Stinner2011-10-141-0/+5
| | | | | | | | wcsftime() doesn't format time zone correctly.
* | Add API for static strings, primarily good for identifiers.Martin v. Löwis2011-10-091-2/+3
| | | | | | | | Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
* | Issue #12459: time.sleep() now raises a ValueError if the sleep length isVictor Stinner2011-07-051-0/+5
| | | | | | | | | | negative, instead of an infinite sleep on Windows or raising an IOError on Linux for example, to have the same behaviour on all platforms.
* | Issue #9642: Uniformize the tests on the availability of the mbcs codecVictor Stinner2011-07-041-1/+1
| | | | | | | | Add a new HAVE_MBCS define.
* | Issue #9642: Fix the definition of time.clock() on WindowsVictor Stinner2011-07-041-29/+25
| | | | | | | | | | Don't unset and set againt the HAVE_CLOCK define, reorder the #if tests instead. Fix also the definition of the timezone encoding.
* | Issue #12462: time.sleep() now calls immediatly the (Python) signal handler ifVictor Stinner2011-07-011-6/+11
| | | | | | | | | | | | | | it is interrupted by a signal, instead of having to wait until the next instruction. Patch reviewed by Antoine Pitrou.
* | Removed unused variableAlexander Belopolsky2011-05-021-1/+0
| |
* | Issue #11930: Remove deprecated time.accept2dyear.Alexander Belopolsky2011-05-021-54/+1
| |
* | merge from 3.2Senthil Kumaran2011-04-061-1/+1
|\ \ | |/
| * Merge from 3.1Senthil Kumaran2011-04-061-1/+1
| |\
| | * Issue #10762: Guard against invalid/non-supported format string '%f' on ↵Senthil Kumaran2011-04-061-1/+1
| | | | | | | | | | | | Windows. Patch Santoso Wijaya.
* | | Issue #10833: Use PyUnicode_FromFormat() and PyErr_Format() instead ofVictor Stinner2011-03-211-20/+9
|/ / | | | | | | PyOS_snprintf().
* | time.strftime(): replace PyErr_Format() by PyErr_SetString()Victor Stinner2011-03-211-3/+2
| | | | | | | | The argument was not used in the format string.
* | #11565: Merge with 3.1.Ezio Melotti2011-03-161-1/+1
|\ \ | |/
| * #11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-161-1/+1
| |
| * Merged revisions 87919 via svnmerge fromAlexander Belopolsky2011-02-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87919 | alexander.belopolsky | 2011-01-10 20:21:25 -0500 (Mon, 10 Jan 2011) | 4 lines Issue #1726687: time.mktime() will now correctly compute value one second before epoch. Original patch by Peter Wang, reported by Martin Blais. ........
| * Merged revisions 87136,87221,87256,87337-87338,87571,87839,88164 via ↵R. David Murray2011-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87136 | r.david.murray | 2010-12-08 17:53:00 -0500 (Wed, 08 Dec 2010) | 6 lines Have script_helper._assert_python strip refcount strings from stderr. This makes the output of the function and those that depend on it independent of whether or not they are being run under a debug build. ........ r87221 | r.david.murray | 2010-12-13 19:55:46 -0500 (Mon, 13 Dec 2010) | 4 lines #10699: fix docstring for tzset: it does not take a parameter Thanks to Garrett Cooper for the fix. ........ r87256 | r.david.murray | 2010-12-14 21:19:14 -0500 (Tue, 14 Dec 2010) | 2 lines #10705: document what the values of debuglevel are and mean. ........ r87337 | r.david.murray | 2010-12-17 11:11:40 -0500 (Fri, 17 Dec 2010) | 2 lines #10559: provide instructions for accessing sys.argv when first mentioned. ........ r87338 | r.david.murray | 2010-12-17 11:29:07 -0500 (Fri, 17 Dec 2010) | 2 lines #10454: clarify the compileall docs and help messages. [compileall.py changes not backported.] ........ r87571 | r.david.murray | 2010-12-29 14:06:48 -0500 (Wed, 29 Dec 2010) | 2 lines Fix same typo in docs. ........ r87839 | r.david.murray | 2011-01-07 16:57:25 -0500 (Fri, 07 Jan 2011) | 9 lines Fix formatting of values with embedded newlines when rfc2047 encoding Before this patch if a value being encoded had an embedded newline, the line following the newline would have no leading whitespace, and the whitespace it did have was encoded into the word. Now the existing whitespace gets turned into a blank, the way it does in other header reformatting, and the _continuation_ws gets added at the beginning of the encoded line. ........ r88164 | r.david.murray | 2011-01-24 14:34:58 -0500 (Mon, 24 Jan 2011) | 12 lines #10960: fix 'stat' links, link to lstat from stat, general tidy of stat doc. Original patch by Michal Nowikowski, with some additions and wording fixes by me. I changed the wording from 'Performs a stat system call' to 'Performs the equivalent of a stat system call', since on Windows there are no stat/lstat system calls involved. I also extended Michal's breakout of the attributes into a list to the other paragraphs, and rearranged the order of the paragraphs in the 'stat' docs to make it flow better and put it in what I think is a more logical/useful order. ........
| * Merged revisions 87648,87656 via svnmerge fromAlexander Belopolsky2011-01-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87648 | alexander.belopolsky | 2011-01-02 15:48:22 -0500 (Sun, 02 Jan 2011) | 1 line Issue #8013: Fixed time.asctime segfault when OS's asctime fails ........ r87656 | alexander.belopolsky | 2011-01-02 17:16:10 -0500 (Sun, 02 Jan 2011) | 1 line Issue #8013: Fixed test ........
| * Recorded merge of revisions 81032 via svnmerge fromAntoine Pitrou2010-05-091-637/+637
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines Recorded merge of revisions 81029 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........ ................
* | Issue #1726687: time.mktime() will now correctly compute value oneAlexander Belopolsky2011-01-111-1/+4
| | | | | | | | | | second before epoch. Original patch by Peter Wang, reported by Martin Blais.
* | Issue #10864: limit year to [1; 9999] for strftime() on SolarisVictor Stinner2011-01-081-1/+1
| |
* | Issue #1777412: Remove all limits on tm_year from time.strftime()Victor Stinner2011-01-081-8/+1
| | | | | | | | The buildbots will tell us which platform does support or not negative years.
* | Issue #1777412: strftime() accepts year >= 1 instead of year >= 1900Victor Stinner2011-01-081-6/+12
| | | | | | | | | | * With Visual Studio, year have to be in [1; 9999] * Add more tests on the year field
* | Fixed error handling branches. ThanksAlexander Belopolsky2011-01-081-14/+19
| | | | | | | | Victor Stinner for pointing this out.
* | Issue #1777412: extended year range of strftime down to 1000.Alexander Belopolsky2011-01-081-2/+2
| |
* | Issue #10827: Changed the rules for 2-digit years. The time.asctimeAlexander Belopolsky2011-01-071-15/+32
| | | | | | | | | | | | | | | | function will now format any year when time.accept2dyear is false and will accept years >= 1000 otherwise. The year range accepted by time.mktime and time.strftime is still system dependent, but time.mktime will now accept full range supported by the OS. Conversion of 2-digit years to 4-digit is deprecated.
* | Further simplify gettmarg()Alexander Belopolsky2011-01-061-19/+5
| |
* | Use PyOS_snprintf for better portability.Alexander Belopolsky2011-01-061-5/+5
| |
* | - time.accept2dyear = True is now equivalent to time.accept2dyear = 1Alexander Belopolsky2011-01-051-34/+19
| | | | | | | | | | | | - removed unnecessary struct_time to tuple conversion - added more unit tests (See issue #10827 for discussion.)
* | Whitespace cleanupAlexander Belopolsky2011-01-041-2/+1
| |
* | Issue #8013: time.asctime and time.ctime no longer call system asctimeAlexander Belopolsky2011-01-041-22/+39
| | | | | | | | | | | | | | and ctime functions. The year range for time.asctime is now 1900 through maxint. The range for time.ctime is the same as for time.localtime. The string produced by these functions is longer than 24 characters when year is greater than 9999.
* | #8013 follow-up:Georg Brandl2011-01-021-7/+13
| | | | | | | | | | | | * In asctime and ctime, properly remove the newline if the year has more than four digits * Consistent error message for both functions * Fix the test comments and add a check for the removed newline
* | Issue #8013: Fixed time.asctime segfault when OS's asctime failsAlexander Belopolsky2011-01-021-0/+4
| |
* | #10699: fix docstring for tzset: it does not take a parameterR. David Murray2010-12-141-1/+1
| | | | | | | | Thanks to Garrett Cooper for the fix.
* | Include structseq.h in Python.h, and remove now-redundant includes in ↵Georg Brandl2010-11-301-1/+0
| | | | | | | | individual sources.
* | PyUnicode_AsWideCharString() takes a PyObject*, not a PyUnicodeObject*Victor Stinner2010-10-071-1/+1
| | | | | | | | | | All unicode functions uses PyObject* except PyUnicode_AsWideChar(). Fix the prototype for the new function PyUnicode_AsWideCharString().
* | time: fix gcc warningVictor Stinner2010-10-071-27/+28
| | | | | | | | | | * Create format_arg variable to use the right types * Strip trailing spaces
* | Issue #6608: time.asctime is now checking struct tm fields its inputAlexander Belopolsky2010-10-011-62/+76
| | | | | | | | before passing it to the system asctime. Patch by MunSic Jeong.
* | Issue #9979: Use PyUnicode_AsWideCharString() in time.strftime()Victor Stinner2010-09-291-21/+20
| | | | | | | | | | Allocate memory with PyMem_Alloc() instead of the PyBytes API. Prepare the surrogates support.
* | Issue #9079: Added _PyTime_gettimeofday(_PyTime_timeval *tp) to C APIAlexander Belopolsky2010-08-051-55/+4
| | | | | | | | | | | | exposed in Python.h. This function is similar to POSIX gettimeofday(struct timeval *tp), but available on platforms without gettimeofday().
* | Issue #9012: "Separate compilation of time and datetime modules."Alexander Belopolsky2010-06-161-26/+0
| | | | | | | | | | | | | | Segregated code shared between time and datetime modules into Modules/_time.c. Added a new header file, Modules/_time.h, which will be used instead of Include/timefuncs.h for declarations shared between time and datetime modules.
* | Merged revisions 81756 via svnmerge fromAlexander Belopolsky2010-06-051-10/+16
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81756 | alexander.belopolsky | 2010-06-05 10:54:26 -0400 (Sat, 05 Jun 2010) | 1 line Issue #8899: time.struct_time now has class and atribute docstrings. ........
* | Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-632/+632
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* | Poor PLAN9, it isn't supportedAntoine Pitrou2010-02-221-16/+0
| |
* | Merged revisions 75020 via svnmerge fromBrett Cannon2009-09-221-42/+43
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75020 | brett.cannon | 2009-09-22 12:13:27 -0700 (Tue, 22 Sep 2009) | 1 line Fix whitespace. ........
* | Merged revisions 75011 via svnmerge fromBrett Cannon2009-09-221-5/+7
|/ | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75011 | brett.cannon | 2009-09-21 17:29:48 -0700 (Mon, 21 Sep 2009) | 10 lines When range checking was added to time.strftime() a check was placed on tm_isdst to make sure it fell within [-1, 1] just in case someone implementing strftime() in libc was stupid enough to assume this. Turns out, though, some OSs (e.g. zOS) are stupid enough to use values outside of this range for time structs created by the system itself. So instead of throwing a ValueError, tm_isdst is now normalized before being passed to strftime(). Fixes issue #6823. Thanks Robert Shapiro for diagnosing the problem and contributing an initial patch. ........