Commit graph

169 commits

Author SHA1 Message Date
Alexander Belopolsky
fdc860f310 Issue #9527: datetime.astimezone() method will now supply a class
timezone instance corresponding to the system local timezone when
called with no arguments.
2012-06-22 12:23:23 -04:00
Alexander Belopolsky
0831382d69 Issue #15006: Allow equality comparison between naive and aware time
or datetime objects.
2012-06-15 20:19:47 -04:00
Alexander Belopolsky
a4415141da Issue #2736: Added datetime.timestamp() method. 2012-06-08 12:33:09 -04:00
R David Murray
d91dc62379 Merge #14766: Add correct algorithm for when a 'time' object is naive.
This patch also clarifies the definition of Naive and Aware.

Original patch by Greg Weller, I modified the first hunk
somewhat to make the exposition even clearer (I hope).
2012-05-14 22:19:10 -04:00
R David Murray
539f239e88 #14766: Reflow the altered paragraphs. 2012-05-14 22:17:23 -04:00
R David Murray
9075d8b771 #14766: Add correct algorithm for when a 'time' object is naive.
This patch also clarifies the definition of Naive and Aware.

Original patch by Greg Weller, I modified the first hunk
somewhat to make the exposition even clearer (I hope).
2012-05-14 22:14:46 -04:00
Sandro Tosi
4aff7ed332 Issue #14448: merge with 3.2 2012-04-28 11:19:59 +02:00
Sandro Tosi
100b889ccd Issue #14448: add reference to IANA timezone database; thanks to Georg/Nick suggestions 2012-04-28 11:19:37 +02:00
Sandro Tosi
17feca0efc Issue #14448: merge with 3.2 2012-04-24 19:46:29 +02:00
Sandro Tosi
d11d0d6343 Issue #14448: mention pytz; patch by Andrew Svetlov 2012-04-24 19:46:06 +02:00
Victor Stinner
ecc6e6613f Fix doc of datetime.date*.*fromtimestamp() methods 2012-03-14 00:39:29 +01:00
Victor Stinner
21f5893571 Issue #14180: datetime.date.fromtimestamp(), datetime.datetime.fromtimestamp()
and datetime.datetime.utcfromtimestamp() now raise an OSError instead of
ValueError if localtime() or gmtime() failed.
2012-03-14 00:15:40 +01:00
Victor Stinner
5d272cc6a2 Close #14180: Factorize code to convert a number of seconds to time_t, 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.
2012-03-13 13:35:55 +01:00
Sandro Tosi
b6dbc9ee15 merge with 3.2 2011-11-01 10:32:22 +01:00
Sandro Tosi
4bfe03a42e correct signature for tzinfo.dst() in examples; thanks to Daniil Shved from docs@ 2011-11-01 10:32:05 +01:00
Ezio Melotti
6fe679f011 #13076: merge with 3.2. 2011-10-02 12:47:10 +03:00
Ezio Melotti
35ec7f771b #13076: fix links to datetime.time and datetime.datetime. 2011-10-02 12:44:50 +03:00
Georg Brandl
902e895578 merge doc fixes from 3.2 2011-09-17 20:40:35 +02:00
Georg Brandl
755460694e Fix typo. 2011-09-17 20:20:04 +02:00
Senthil Kumaran
42d1320c06 merge from 3.2 2011-07-17 19:06:03 +08:00
Senthil Kumaran
023c6f703d Fix Issue10403 - datetime documentation clarification based on review in the reitveld by Alexendar belopolsky. 2011-07-17 19:01:14 +08:00
Senthil Kumaran
8fbfc12f5e merge from 3.2 2011-07-04 11:44:17 -07:00
Senthil Kumaran
3aac179498 Fix whitespace nit in datetime and os rst files. 2011-07-04 11:43:51 -07:00
Senthil Kumaran
276a58b821 Merge from 3.2 . Replace the term members with correct and appropriate terminology. Initial patch by Adam Woodbeck. 2011-07-04 11:31:53 -07:00
Senthil Kumaran
a6bac95a3c issue10403 - Let's not use members anymore. Use 'attribute' where it denotes attribute and 'methods' where it denotes methods. Context should clarify usage. 2011-07-04 11:28:30 -07:00
Alexander Belopolsky
6d3c9a6893 Mention that timezone is a subclass of tzinfo. 2011-05-04 10:28:26 -04:00
Alexander Belopolsky
5611a1c326 Issue #11930: Added Misc/NEWS and versionchanged entries. 2011-05-02 14:14:48 -04:00
Alexander Belopolsky
89da349b7b Issue #11930: Remove year >= 1000 limitation from datetime.strftime.
Patch by Victor Stinner.
2011-05-02 13:14:24 -04:00
Alexander Belopolsky
54afa5504c Issue #2736: Documented how to compute seconds since epoch. 2011-04-25 13:00:40 -04:00
Alexander Belopolsky
5fc850b455 Improved footnote for the %Y directive slightly. 2011-01-10 23:31:51 +00:00
Alexander Belopolsky
085556ae89 Improved description of %Y directive. 2011-01-10 23:28:33 +00:00
Alexander Belopolsky
9971e001ef Issue #2568: Removed bogus rationale for supporting tm_sec=61. 2011-01-10 22:56:14 +00:00
Alexander Belopolsky
2997837158 Fixed documentation to reflect recent changes for years < 1900. 2011-01-08 20:47:21 +00:00
Georg Brandl
682d7e0e07 Fix errors found by "make suspicious". 2010-10-06 10:26:05 +00:00
Georg Brandl
60203b41b0 Migrate to Sphinx 1.0 C language constructs. 2010-10-06 10:11:56 +00:00
Georg Brandl
67b21b7547 Consistency check for versionadded/changed directives. 2010-08-17 15:07:14 +00:00
Georg Brandl
f55c31594b #9430: document timedelta str() and repr(). 2010-07-31 11:40:07 +00:00
Alexander Belopolsky
75f94c210a Issue #9005: Prevent utctimetuple() from producing year 0 or year 10,000. 2010-06-21 15:21:14 +00:00
Alexander Belopolsky
49d7a57f33 Added a new line at the end of the file. 2010-06-18 16:57:49 +00:00
Alexander Belopolsky
ca94f55758 Issue #6641: The datetime.strptime method now supports the %z directive. 2010-06-17 18:30:34 +00:00
Alexander Belopolsky
b39a0c242d Issue 5094: minor documentation fixes 2010-06-15 19:24:52 +00:00
Alexander Belopolsky
4e749a1113 Issue #5094: The `datetime` module now has a simple concrete class
implementing ``datetime.tzinfo`` interface.
2010-06-14 14:15:50 +00:00
Alexander Belopolsky
da62f2fe28 Merged revisions 81864 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81864 | alexander.belopolsky | 2010-06-09 13:08:11 -0400 (Wed, 09 Jun 2010) | 1 line

  Fixed markup of tm_isdst attribute.
........
2010-06-09 17:11:01 +00:00
Alexander Belopolsky
649124856a Merged revisions 81489 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81489 | georg.brandl | 2010-05-23 17:29:29 -0400 (Sun, 23 May 2010) | 1 line

  #1436346: make it more obvious that timetuple[7] is yday.
........
2010-06-08 18:59:20 +00:00
Alexander Belopolsky
1790bc43bf Issue #1289118: datetime.timedelta objects can now be multiplied by float
and divided by float and int objects.
2010-05-31 17:33:47 +00:00
Mark Dickinson
0381e3f16a Issue #8644: Improve accuracy of timedelta.total_seconds, by doing intermediate
computations with integer arithmetic instead of floating point.
td.total_seconds() now agrees with td / timedelta(seconds = 1).

Thanks Alexander Belopolsky for the patch.
2010-05-08 14:35:02 +00:00
Mark Dickinson
7c186e2a18 Issue #2706: Add support for dividing a timedelta by another timedelta.
Adds support for the three division operations:

  - timedelta / timedelta -> float
  - timedelta // timedelta -> int
  - timedelta % timedelta -> timedelta

also adds support for divmod(timedelta, timedelta).

Patch by Victor Stinner, adapted for py3k and extended by Alexander
Belopolsky.
2010-04-20 22:32:49 +00:00
Georg Brandl
7bc6e4fd06 Merged revisions 79184-79185 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79184 | georg.brandl | 2010-03-21 10:58:36 +0100 (So, 21 Mär 2010) | 1 line

  Update text for newest US DST regulation.  The sample file already has the calculation right.
........
  r79185 | georg.brandl | 2010-03-21 11:02:47 +0100 (So, 21 Mär 2010) | 1 line

  Include structmember.h correctly.
........
2010-03-21 10:03:36 +00:00
Benjamin Peterson
5e55b3e204 Merged revisions 77484,77487,77561,77570,77593,77603,77608,77667,77702-77703,77739,77858,77887,77889 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77484 | skip.montanaro | 2010-01-13 19:12:34 -0600 (Wed, 13 Jan 2010) | 4 lines

  Update PyEval_EvalFrame to PyEval_EvalFrameEx.  This looks to have been done
  partially before.  Also add a comment describing how this might have to work
  with different versions of the interpreter.
........
  r77487 | ezio.melotti | 2010-01-14 05:34:10 -0600 (Thu, 14 Jan 2010) | 1 line

  Fixed typo
........
  r77561 | georg.brandl | 2010-01-17 02:42:30 -0600 (Sun, 17 Jan 2010) | 1 line

  #7699: improve datetime docs: straightforward linking to strftime/strptime section, mark classmethods as such.
........
  r77570 | georg.brandl | 2010-01-17 06:14:42 -0600 (Sun, 17 Jan 2010) | 1 line

  Add note about usage of STRINGLIB_EMPTY.
........
  r77593 | georg.brandl | 2010-01-17 17:33:53 -0600 (Sun, 17 Jan 2010) | 1 line

  Fix internal reference.
........
  r77603 | benjamin.peterson | 2010-01-18 17:07:56 -0600 (Mon, 18 Jan 2010) | 8 lines

  data descriptors do not override the class dictionary if __get__ is not defined

  Adjust documentation and add a test to verify this behavior.

  See http://mail.python.org/pipermail/python-dev/2010-January/095637.html for
  discussion.
........
  r77608 | gregory.p.smith | 2010-01-19 02:19:03 -0600 (Tue, 19 Jan 2010) | 6 lines

  Do not compile stubs for the sha2 series hashes in the openssl hashlib
  module when the openssl version is too old to support them.  That
  leads both compiled code bloat and to unittests attempting to test
  implementations that don't exist for comparison purposes on such
  platforms.
........
  r77667 | mark.dickinson | 2010-01-21 12:32:27 -0600 (Thu, 21 Jan 2010) | 1 line

  Add two more test_strtod test values.
........
  r77702 | georg.brandl | 2010-01-23 02:43:31 -0600 (Sat, 23 Jan 2010) | 1 line

  #7762: fix refcount annotation of PyUnicode_Tailmatch().
........
  r77703 | georg.brandl | 2010-01-23 02:47:54 -0600 (Sat, 23 Jan 2010) | 1 line

  #7725: fix referencing issue.
........
  r77739 | benjamin.peterson | 2010-01-24 21:52:52 -0600 (Sun, 24 Jan 2010) | 1 line

  mention from_float() in error message
........
  r77858 | georg.brandl | 2010-01-30 11:57:48 -0600 (Sat, 30 Jan 2010) | 1 line

  #7802: fix invalid example (heh).
........
  r77887 | georg.brandl | 2010-01-31 12:51:49 -0600 (Sun, 31 Jan 2010) | 5 lines

  Fix-up ftplib documentation:
  move exception descriptions to toplevel, not inside a class
  remove attribution in "versionadded"
  spell and grammar check docstring of FTP_TLS
........
  r77889 | michael.foord | 2010-01-31 13:59:26 -0600 (Sun, 31 Jan 2010) | 1 line

  Minor modification to unittest documentation.
........
2010-02-03 02:35:45 +00:00
Antoine Pitrou
be6859d877 Merged revisions 76529 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76529 | antoine.pitrou | 2009-11-25 23:59:36 +0100 (mer., 25 nov. 2009) | 4 lines

  Issue #5788: `datetime.timedelta` objects get a new `total_seconds()` method returning
  the total number of seconds in the duration.  Patch by Brian Quinlan.
........
2009-11-25 23:02:32 +00:00