[Python-checkins] python/dist/src/Doc/lib libdatetime.tex,1.38,1.39

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Thu, 23 Jan 2003 12:53:40 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv6370/python/Doc/lib

Modified Files:
	libdatetime.tex 
Log Message:
SF bug 660872:  datetimetz constructors behave counterintuitively (2.3a1).
This gives much the same treatment to datetime.fromtimestamp(stamp, tz) as
the last batch of checkins gave to datetime.now(tz):  do "the obvious"
thing with the tz argument instead of a senseless thing.


Index: libdatetime.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdatetime.tex,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** libdatetime.tex	23 Jan 2003 19:57:59 -0000	1.38
--- libdatetime.tex	23 Jan 2003 20:53:07 -0000	1.39
***************
*** 535,541 ****
  
    Else \var{tz} must be an instance of a class \class{tzinfo} subclass,
!   and the current date and time are translated to \var{tz}'s time
    zone.  In this case the result is equivalent to
!   \code{\var{tz}.fromutc(datetime.utcnow().replace(tzinfo=\var{tz})}.
    See also \method{today()}, \method{utcnow()}.
  \end{methoddesc}
--- 535,541 ----
  
    Else \var{tz} must be an instance of a class \class{tzinfo} subclass,
!   and the current date and time are converted to \var{tz}'s time
    zone.  In this case the result is equivalent to
!   \code{\var{tz}.fromutc(datetime.utcnow().replace(tzinfo=\var{tz}))}.
    See also \method{today()}, \method{utcnow()}.
  \end{methoddesc}
***************
*** 543,558 ****
  \begin{methoddesc}{utcnow}{}
    Return the current UTC date and time, with \member{tzinfo} \code{None}.
!   This is like \method{now()}, but  returns the current UTC date and time,
    as a naive \class{datetime} object.
    See also \method{now()}.
  \end{methoddesc}
  
! \begin{methoddesc}{fromtimestamp}{timestamp}
!   Return the local \class{datetime} corresponding to the \POSIX{}
!   timestamp, such as is returned by \function{time.time()}.  This
!   may raise \exception{ValueError}, if the timestamp is out of the
!   range of values supported by the platform C
!   \cfunction{localtime()} function.  It's common for this to be
!   restricted to years in 1970 through 2038.
    Note that on non-POSIX systems that include leap seconds in their
    notion of a timestamp, leap seconds are ignored by
--- 543,567 ----
  \begin{methoddesc}{utcnow}{}
    Return the current UTC date and time, with \member{tzinfo} \code{None}.
!   This is like \method{now()}, but returns the current UTC date and time,
    as a naive \class{datetime} object.
    See also \method{now()}.
  \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()}.
!   If optional argument \var{tz} is \code{None} or not specified, the
!   timestamp is converted to the platform's local date and time, and
!   the returned \class{datetime} object is naive.
! 
!   Else \var{tz} must be an instance of a class \class{tzinfo} subclass,
!   and the timestamp is converted to \var{tz}'s time zone.  In this case
!   the result is equivalent to
!   \code{\var{tz}.fromutc(datetime.utcfromtimestamp(\var{timestamp}).replace(tzinfo=\var{tz}))}.
! 
!   \method{fromtimestamp()} may raise \exception{ValueError}, if the
!   timestamp is out of the range of values supported by the platform C
!   \cfunction{localtime()} or \cfunction(gmtime()} functions.  It's common
!   for this to be restricted to years in 1970 through 2038.
    Note that on non-POSIX systems that include leap seconds in their
    notion of a timestamp, leap seconds are ignored by