[Python-checkins] python/dist/src/Doc/lib libdatetime.tex, 1.51,
1.52
fdrake at users.sourceforge.net
fdrake at users.sourceforge.net
Tue Dec 30 15:36:23 EST 2003
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv18132
Modified Files:
libdatetime.tex
Log Message:
lots of markup adjustments
Index: libdatetime.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdatetime.tex,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** libdatetime.tex 6 Sep 2003 05:36:13 -0000 1.51
--- libdatetime.tex 30 Dec 2003 20:36:20 -0000 1.52
***************
*** 107,111 ****
The distinction between naive and aware doesn't apply to
! \code{timedelta} objects.
Subclass relationships:
--- 107,111 ----
The distinction between naive and aware doesn't apply to
! \class{timedelta} objects.
Subclass relationships:
***************
*** 125,133 ****
between two dates or times.
! \begin{classdesc}{timedelta}{days=0, seconds=0, microseconds=0,
! milliseconds=0, minutes=0, hours=0, weeks=0}
!
! All arguments are optional. Arguments may be ints, longs, or floats,
! and may be positive or negative.
Only \var{days}, \var{seconds} and \var{microseconds} are stored
--- 125,133 ----
between two dates or times.
! \begin{classdesc}{timedelta}{\optional{days\optional{, seconds\optional{,
! microseconds\optional{, milliseconds\optional{,
! minutes\optional{, hours\optional{, weeks}}}}}}}}
! All arguments are optional and default to \code{0}. Arguments may
! be ints, longs, or floats, and may be positive or negative.
Only \var{days}, \var{seconds} and \var{microseconds} are stored
***************
*** 210,215 ****
\lineii{\var{t1} = \var{t2} - \var{t3}}
{Difference of \var{t2} and \var{t3}.
! Afterwards \var{t1} == \var{t2} - \var{t3} and \var{t2} == \var{t1} + \var{t3} are
! true.
(1)}
\lineii{\var{t1} = \var{t2} * \var{i} or \var{t1} = \var{i} * \var{t2}}
--- 210,215 ----
\lineii{\var{t1} = \var{t2} - \var{t3}}
{Difference of \var{t2} and \var{t3}.
! Afterwards \var{t1} == \var{t2} - \var{t3} and
! \var{t2} == \var{t1} + \var{t3} are true.
(1)}
\lineii{\var{t1} = \var{t2} * \var{i} or \var{t1} = \var{i} * \var{t2}}
***************
*** 353,357 ****
Supported operations:
- % XXX rewrite to be a table
\begin{tableii}{c|l}{code}{Operation}{Result}
\lineii{\var{date2} = \var{date1} + \var{timedelta}}
--- 353,356 ----
***************
*** 367,371 ****
{(3)}
! \lineii{\var{date1}<\var{date2}}
{\var{date1} is considered less than \var{date2} when \var{date1}
precedes \var{date2} in time. (4)}
--- 366,370 ----
{(3)}
! \lineii{\var{date1} < \var{date2}}
{\var{date1} is considered less than \var{date2} when \var{date1}
precedes \var{date2} in time. (4)}
***************
*** 521,527 ****
Constructor:
! \begin{classdesc}{datetime}{year, month, day,
! hour=0, minute=0, second=0, microsecond=0,
! tzinfo=None}
The year, month and day arguments are required. \var{tzinfo} may
be \code{None}, or an instance of a \class{tzinfo} subclass. The
--- 520,527 ----
Constructor:
! \begin{classdesc}{datetime}{year, month, day\optional{,
! hour\optional{, minute\optional{,
! second\optional{, microsecond\optional{,
! tzinfo}}}}}}
The year, month and day arguments are required. \var{tzinfo} may
be \code{None}, or an instance of a \class{tzinfo} subclass. The
***************
*** 551,555 ****
\end{methoddesc}
! \begin{methoddesc}{now(tz=None)}{}
Return the current local date and time. If optional argument
\var{tz} is \code{None} or not specified, this is like
--- 551,555 ----
\end{methoddesc}
! \begin{methoddesc}{now}{\optional{tz}}
Return the current local date and time. If optional argument
\var{tz} is \code{None} or not specified, this is like
***************
*** 573,577 ****
\end{methoddesc}
! \begin{methoddesc}{fromtimestamp}{timestamp, tz=None}
Return the local date and time corresponding to the \POSIX{}
timestamp, such as is returned by \function{time.time()}.
--- 573,577 ----
\end{methoddesc}
! \begin{methoddesc}{fromtimestamp}{timestamp\optional{, tz}}
Return the local date and time corresponding to the \POSIX{}
timestamp, such as is returned by \function{time.time()}.
***************
*** 781,786 ****
\end{methoddesc}
! \begin{methoddesc}{replace}{year=, month=, day=, hour=, minute=, second=,
! microsecond=, tzinfo=}
Return a datetime with the same members, except for those members given
new values by whichever keyword arguments are specified. Note that
--- 781,788 ----
\end{methoddesc}
! \begin{methoddesc}{replace}{\optional{year\optional{, month\optional{,
! day\optional{, hour\optional{, minute\optional{,
! second\optional{, microsecond\optional{,
! tzinfo}}}}}}}}}
Return a datetime with the same members, except for those members given
new values by whichever keyword arguments are specified. Note that
***************
*** 912,916 ****
\end{methoddesc}
! \begin{methoddesc}{isoformat}{sep='T'}
Return a string representing the date and time in ISO 8601 format,
YYYY-MM-DDTHH:MM:SS.mmmmmm
--- 914,918 ----
\end{methoddesc}
! \begin{methoddesc}{isoformat}{\optional{sep}}
Return a string representing the date and time in ISO 8601 format,
YYYY-MM-DDTHH:MM:SS.mmmmmm
***************
*** 968,973 ****
particular day, and subject to adjustment via a \class{tzinfo} object.
! \begin{classdesc}{time}{hour=0, minute=0, second=0, microsecond=0,
! tzinfo=None}
All arguments are optional. \var{tzinfo} may be \code{None}, or
an instance of a \class{tzinfo} subclass. The remaining arguments
--- 970,975 ----
particular day, and subject to adjustment via a \class{tzinfo} object.
! \begin{classdesc}{time}{hour\optional{, minute\optional{, second\optional{,
! microsecond\optional{, tzinfo}}}}}
All arguments are optional. \var{tzinfo} may be \code{None}, or
an instance of a \class{tzinfo} subclass. The remaining arguments
***************
*** 982,986 ****
If an argument outside those ranges is given,
! \exception{ValueError} is raised.
\end{classdesc}
--- 984,989 ----
If an argument outside those ranges is given,
! \exception{ValueError} is raised. All default to \code{0} except
! \var{tzinfo}, which defaults to \constant{None}.
\end{classdesc}
***************
*** 1058,1062 ****
Instance methods:
! \begin{methoddesc}{replace}(hour=, minute=, second=, microsecond=, tzinfo=)
Return a \class{time} with the same value, except for those members given
new values by whichever keyword arguments are specified. Note that
--- 1061,1067 ----
Instance methods:
! \begin{methoddesc}{replace}{\optional{hour\optional{, minute\optional{,
! second\optional{, microsecond\optional{,
! tzinfo}}}}}}
Return a \class{time} with the same value, except for those members given
new values by whichever keyword arguments are specified. Note that
***************
*** 1184,1188 ****
must return the same result for every \class{datetime} \var{dt}
! with \code{\var{dt}.tzinfo==\var{tz}} For sane \class{tzinfo}
subclasses, this expression yields the time zone's "standard offset",
which should not depend on the date or the time, but only on geographic
--- 1189,1193 ----
must return the same result for every \class{datetime} \var{dt}
! with \code{\var{dt}.tzinfo == \var{tz}} For sane \class{tzinfo}
subclasses, this expression yields the time zone's "standard offset",
which should not depend on the date or the time, but only on geographic
***************
*** 1198,1213 ****
\begin{verbatim}
! return timedelta(0) # a fixed-offset class: doesn't account for DST
or
! # Code to set dston and dstoff to the time zone's DST transition
! # times based on the input dt.year, and expressed in standard local
! # time. Then
! if dston <= dt.replace(tzinfo=None) < dstoff:
! return timedelta(hours=1)
! else:
! return timedelta(0)
\end{verbatim}
--- 1203,1223 ----
\begin{verbatim}
! def dst(self):
! # a fixed-offset class: doesn't account for DST
! return timedelta(0)
! \end{verbatim}
or
! \begin{verbatim}
! def dst(self):
! # Code to set dston and dstoff to the time zone's DST
! # transition times based on the input dt.year, and expressed
! # in standard local time. Then
! if dston <= dt.replace(tzinfo=None) < dstoff:
! return timedelta(hours=1)
! else:
! return timedelta(0)
\end{verbatim}
***************
*** 1322,1326 ****
to 3:00. A wall time of the form 2:MM doesn't really make sense on that
day, so \code{astimezone(Eastern)} won't deliver a result with
! \code{hour==2} on the
day DST begins. In order for \method{astimezone()} to make this
guarantee, the \method{rzinfo.dst()} method must consider times
--- 1332,1336 ----
to 3:00. A wall time of the form 2:MM doesn't really make sense on that
day, so \code{astimezone(Eastern)} won't deliver a result with
! \code{hour == 2} on the
day DST begins. In order for \method{astimezone()} to make this
guarantee, the \method{rzinfo.dst()} method must consider times
***************
*** 1399,1401 ****
varies across platforms. Regardless of platform, years before 1900
cannot be used.
-
--- 1409,1410 ----
More information about the Python-checkins
mailing list