[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Appendix B: API Reference

webmaster at zope.org webmaster at zope.org
Mon Feb 16 22:39:03 EST 2004


A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixB.stx#2-45

---------------

    DateTime objects may be converted to integer, long, or float
    numbers of days since January 1, 1901, using the standard int, 
    long, and float functions (Compatibility Note: int, long and
    float return the number of days since 1901 in GMT rather than
    local machine timezone). DateTime objects also provide access
    to their value in a float format usable with the python time
    module, provided that the value of the object falls in the
    range of the epoch-based time module.

      % Anonymous User - June 10, 2002 10:51 am:
       It actually seems to return the time in seconds since 1/1/1970, not 1/1/1901.

      % Anonymous User - July 24, 2002 2:32 pm:
       I'm guessing that's a typo -- python has always run time from 1970

      % Anonymous User - Aug. 20, 2002 12:15 am:
       epoch

       [UNIX: prob. from astronomical timekeeping] n. The time and date corresponding to 0 in an operating system's
       clock and timestamp values. Under most UNIX versions the epoch is 00:00:00 GMT, January 1, 1970; under VMS,
       it's 00:00:00 of November 17, 1858 (base date of the U.S. Naval Observatory's ephemerides); on a Macintosh,
       it's the midnight beginning January 1 1904. System time is measured in seconds or ticks past the epoch. Weird
       problems may ensue when the clock wraps around (see wrap around), which is not necessarily a rare event; on
       systems counting 10 ticks per second, a signed 32-bit count of ticks is good only for 6.8 years. The
       1-tick-per-second clock of UNIX is good only until January 18, 2038, assuming at least some software
       continues to consider it signed and that word lengths don't increase by then.

      % Anonymous User - Feb. 16, 2004 10:39 pm:
       on the win2k Pro you can get the system time by 
       <dtml-call "REQUEST.set('cr_tm',_.DateTime())">

       on the win2k Server you can get the system time by
       <dtml-call "REQUEST.set('cr_tm',_.DateTime().Date()+' '+_.DateTime().Time())">

       on the linux red hat9.0 you can get the system time by
       <dtml-call "REQUEST.set('cr_tm',_.DateTime().Date()+' '+_.DateTime().Time())">

       The most different is that on the linux and win2k server you can not get the system time by the function
       "_.DateTime()" directly.
       Good Luck everybody

       We r come from china
       you can contact with me by this mail address: hwang at phoneatworld.com
       or by the MSN: salas_ranata at hotmail.com



More information about the ZDP mailing list