summaryrefslogtreecommitdiffstats
path: root/Modules/_datetimemodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Closes issue #23600: Wrong results from tzinfo.fromutc().Alexander Belopolsky2015-09-281-1/+1
|
* Issue #23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methodsVictor Stinner2015-09-181-8/+63
| | | | | | | | | | | | | of datetime.datetime: microseconds are now rounded to nearest with ties going to nearest even integer (ROUND_HALF_EVEN), instead of being rounding towards zero (ROUND_DOWN). It's important that these methods use the same rounding mode than datetime.timedelta to keep the property: (datetime(1970,1,1) + timedelta(seconds=t)) == datetime.utcfromtimestamp(t) It also the rounding mode used by round(float) for example. Add more unit tests on the rounding mode in test_datetime.
* Issue #22044: Fixed premature DECREF in call_tzinfo_method.Raymond Hettinger2014-07-251-7/+7
|
* Issue #20320: select.select() and select.kqueue.control() now round the timeoutVictor Stinner2014-02-161-2/+2
| | | | | | aways from zero, instead of rounding towards zero. It should make test_asyncio more reliable, especially test_timeout_rounding() test.
* Issue #20530: Argument Clinic's signature format has been revised again.Larry Hastings2014-02-091-2/+4
| | | | | | | The new syntax is highly human readable while still preventing false positives. The syntax also extends Python syntax to denote "self" and positional-only parameters, allowing inspect.Signature objects to be totally accurate for all supported builtins in Python 3.4.
* Issue #20326: Argument Clinic now uses a simple, unique signature toLarry Hastings2014-01-281-3/+3
| | | | | | | | | | annotate text signatures in docstrings, resulting in fewer false positives. "self" parameters are also explicitly marked, allowing inspect.Signature() to authoritatively detect (and skip) said parameters. Issue #20326: Argument Clinic now generates separate checksums for the input and output sections of the block, allowing external tools to verify that the input has not changed (and thus the output is not out-of-date).
* Issue #20390: Small fixes and improvements for Argument Clinic.Larry Hastings2014-01-261-1/+1
|
* Issue #20189: Four additional builtin types (PyTypeObject,Larry Hastings2014-01-241-7/+7
| | | | | | PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type) have been modified to provide introspection information for builtins. Also: many additional Lib, test suite, and Argument Clinic fixes.
* Issue #19273: The marker comments Argument Clinic uses have been changedLarry Hastings2014-01-071-6/+6
| | | | to improve readability.
* Silence more PyObject_INIT() unused value warnings.Christian Heimes2013-12-041-2/+2
|
* Issue #19674: inspect.signature() now produces a correct signatureLarry Hastings2013-11-231-4/+8
| | | | for some builtins.
* Issue #19730: Argument Clinic now supports all the existing PyArgLarry Hastings2013-11-231-5/+5
| | | | | "format units" as legacy converters, as well as two new features: "self converters" and the "version" directive.
* Argument Clinic: rename "self" to "module" for module-level functions.Larry Hastings2013-11-181-11/+12
|
* Issue #19437: Fix datetime_subtract(), handle new_delta() failureVictor Stinner2013-11-071-0/+3
|
* Issue #19514: Deduplicate some _Py_IDENTIFIER declarations.Martin v. Löwis2013-11-071-14/+5
| | | | Patch by Andrei Dorian Duma.
* Issue #16612: Add "Argument Clinic", a compile-time preprocessorLarry Hastings2013-10-191-17/+57
| | | | for C files to generate argument parsing code. (See PEP 436.)
* _datetimemodule.c: fix the compilation warning "conversion from 'double' toVictor Stinner2013-08-271-1/+1
| | | | | 'long', possible loss of data" in delta_new(), use an explicit cast from double to long
* Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-7/+7
|\ | | | | | | error messages and comments.
| * Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-7/+7
| | | | | | | | error messages and comments.
* | Reuse us_per_second in delta_total_seconds.Alexander Belopolsky2013-08-041-9/+1
| |
* | Fixes #8860: Round half-microseconds to even in the timedelta constructor.Alexander Belopolsky2013-08-041-18/+31
| | | | | | | | (Original patch by Mark Dickinson.)
* | Fix NULL ptr dereferencing in local_timezone(). nameo can be NULLChristian Heimes2013-06-291-1/+1
| | | | | | | | | | CID 1040362 (#1 of 1): Explicit null dereferenced (FORWARD_NULL) var_deref_op: Dereferencing null pointer _py_decref_tmp.
* | Fix time.mktime() and datetime.datetime.timestamp() on AIXVictor Stinner2013-06-251-3/+10
| | | | | | | | | | | | On AIX, the C function mktime() alwaysd sets tm_wday, even on error. So tm_wday cannot be used as a sentinel to detect an error, we can only check if the result is (time_t)-1.
* | Issue #17917: Use PyModule_AddIntMacro() instead of PyModule_AddIntConstant()Charles-Francois Natali2013-05-201-2/+2
|/ | | | when applicable.
* Fix a few typos and a double semicolon. Patch by Eitan Adler.Ezio Melotti2013-01-271-1/+1
|
* Issue #16096: Fix several occurrences of potential signed integer overflow. ↵Mark Dickinson2012-10-061-4/+3
| | | | Thanks Serhiy Storchaka.
* Closes #15973: fix a segmentation fault when comparing timezone objects.Georg Brandl2012-09-221-0/+6
|
* Issue #9527: tm_gmtoff has 'correct' sign.Alexander Belopolsky2012-06-221-7/+3
|
* Fixed compiler warnings in datetime_astimezone()Alexander Belopolsky2012-06-221-4/+5
|
* Issue #9527: Fixes for platforms without tm_zoneAlexander Belopolsky2012-06-221-20/+22
|
* Issue #9527: datetime.astimezone() method will now supply a classAlexander Belopolsky2012-06-221-4/+82
| | | | | timezone instance corresponding to the system local timezone when called with no arguments.
* Issue #15006: Allow equality comparison between naive and aware timeAlexander Belopolsky2012-06-161-0/+16
| | | | or datetime objects.
* Issue #2736: Added datetime.timestamp() method.Alexander Belopolsky2012-06-081-0/+49
|
* Issue #14180: datetime.date.fromtimestamp(), datetime.datetime.fromtimestamp()Victor Stinner2012-03-131-36/+39
| | | | | and datetime.datetime.utcfromtimestamp() now raise an OSError instead of ValueError if localtime() or gmtime() failed.
* Close #14180: Factorize code to convert a number of seconds to time_t, ↵Victor Stinner2012-03-131-32/+13
| | | | | | | | | | | | | timeval or timespec time.ctime(), gmtime(), time.localtime(), datetime.date.fromtimestamp(), datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now raises an OverflowError, instead of a ValueError, if the timestamp does not fit in time_t. datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now round microseconds towards zero instead of rounding to nearest with ties going away from zero.
* Remove an unnecessary extra copy of the bytes hash function.Gregory P. Smith2012-01-141-15/+1
| | | | | | | | | This copy also had a bug in it, it fails to incorporate the length into the hash by using it as the loop variable so it'll always be -1 by the time it is XORed in. As such: I'm doing this only in Python 3.3 and not backporting as it would change the existing hash behavior of datetime objects.
* Fix misuse of PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()Victor Stinner2011-11-211-2/+2
| | | | And PyUnicode_GetSize() => PyUnicode_GetLength()
* Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-19/+19
|
* Use identifier API for PyObject_GetAttrString.Martin v. Löwis2011-10-101-2/+4
|
* Add API for static strings, primarily good for identifiers.Martin v. Löwis2011-10-091-25/+52
| | | | Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
* Implement PEP 393.Martin v. Löwis2011-09-281-6/+5
|
* Issue #1621: Fix undefined behaviour from signed overflow in datetime module ↵Mark Dickinson2011-09-251-4/+4
| | | | hashes, array and list iterations, and get_integer (stringlib/string_format.h)
* Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.Brian Curtin2011-08-111-38/+21
| | | | The macro was introduced in #12724.
* Issue #11930: Remove year >= 1000 limitation from datetime.strftime.Alexander Belopolsky2011-05-021-25/+0
| | | | Patch by Victor Stinner.
* Issue #11576: Fixed timedelta subtraction glitch on big timedelta valuesAlexander Belopolsky2011-04-061-7/+8
|\
| * Issue #11576: Fixed timedelta subtraction glitch on big timedelta valuesAlexander Belopolsky2011-04-061-7/+8
| |
* | Issue #10833: Use PyErr_Format() and PyUnicode_FromFormat() instead ofVictor Stinner2011-03-211-6/+3
| | | | | | | | | | PyOS_snprintf() to avoid temporary buffer allocated on the stack and a conversion from bytes to Unicode.
* | Issue #8914: fix various warnings from the Clang static analyzer v254.Brett Cannon2011-02-221-1/+1
|/
* Issue #1777412: extended year range of strftime down to 1000.Alexander Belopolsky2011-01-081-6/+6
|
* Issue #6697: Fixed instances of _PyUnicode_AsString() result not checked for ↵Alexander Belopolsky2010-12-081-1/+2
| | | | NULL