summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-12-24 05:41:27 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-12-24 05:41:27 (GMT)
commit12bf339aea9c787f7ce655d613b8898f7511c7db (patch)
tree76be8d276190e6fea0be7dd771466b8f326f5de3 /Doc
parenta2a3cb23defa5e17a159982adac33e3dd58d8a93 (diff)
downloadcpython-12bf339aea9c787f7ce655d613b8898f7511c7db.zip
cpython-12bf339aea9c787f7ce655d613b8898f7511c7db.tar.gz
cpython-12bf339aea9c787f7ce655d613b8898f7511c7db.tar.bz2
Implemented .replace() methods for date, datetime, datetimetz, time and
timetz.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libdatetime.tex29
1 files changed, 28 insertions, 1 deletions
diff --git a/Doc/lib/libdatetime.tex b/Doc/lib/libdatetime.tex
index a7d9926..8bfc2bf 100644
--- a/Doc/lib/libdatetime.tex
+++ b/Doc/lib/libdatetime.tex
@@ -365,6 +365,12 @@ Supported operations:
Instance methods:
+ - replace(year=, month=, day=)
+ Return a date with the same value, except for those fields given
+ new values by whichever keyword arguments are specified. For
+ example, if \code{d == date(2002, 12, 31)}, then
+ \code{d.replace(day=26) == date(2000, 12, 26)}.
+
- timetuple()
Return a 9-element tuple of the form returned by
\function{time.localtime()}. The hours, minutes and seconds are
@@ -591,6 +597,10 @@ Instance methods:
- time()
Return time object with same hour, minute, second and microsecond.
+ - replace(year=, month=, day=, hour=, minute=, second=, microsecond=)
+ Return a datetime with the same value, except for those fields given
+ new values by whichever keyword arguments are specified.
+
- timetuple()
Return a 9-element tuple of the form returned by
\function{time.localtime()}.
@@ -710,6 +720,10 @@ Supported operations:
Instance methods:
+ - replace(hour=, minute=, second=, microsecond=)
+ Return a time with the same value, except for those fields given
+ new values by whichever keyword arguments are specified.
+
- isoformat()
Return a string representing the time in ISO 8601 format,
HH:MM:SS.mmmmmm
@@ -857,6 +871,12 @@ Supported operations:
Instance methods:
+ - replace(hour=, minute=, second=, microsecond=, tzinfo=)
+ Return a timetz with the same value, except for those fields given
+ new values by whichever keyword arguments are specified. Note that
+ \code{tzinfo=None} can be specified to create a naive timetz from an
+ aware timetz.
+
- isoformat()
Return a string representing the time in ISO 8601 format,
HH:MM:SS.mmmmmm
@@ -1048,11 +1068,18 @@ Instance methods:
Return \class{timetz} object with same hour, minute, second, microsecond,
and tzinfo.
+ - replace(year=, month=, day=, hour=, minute=, second=, microsecond=,
+ tzinfo=)
+ Return a datetimetz with the same value, except for those fields given
+ new values by whichever keyword arguments are specified. Note that
+ \code{tzinfo=None} can be specified to create a naive datetimetz from
+ an aware datetimetz.
+
- utcoffset()
If \member{tzinfo} is \code{None}, returns \code{None}, else
\code{tzinfo.utcoffset(self)}.
- - tzname():
+ - tzname()
If \member{tzinfo} is \code{None}, returns \code{None}, else
\code{tzinfo.tzname(self)}.