different time tuple format

Rick Holbert holbertr at dma.org
Tue Jun 7 21:09:56 CEST 2005


Like the last poster said, use %Z.  On my Mandriva Linux system I get the
following results:

>>> time.localtime()
(2005, 6, 7, 15, 7, 12, 1, 158, 1)
>>> time.strptime("2005-06-07 15:07:12 EDT", "%Y-%m-%d %H:%M:%S %Z")
(2005, 6, 7, 15, 7, 12, 1, 158, 1)

Rick

Maksim Kasimov wrote:

> hi all, sorry if i'm reposting
> 
> why time.strptime and time.localtime returns tuple with different DST (9
> item of the tuple)? is there some of setting to fix the problem?
> 
> 
> Python 2.2.3 (#1, May 31 2005, 11:33:52)
> [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import time
>  >>> time.strptime("2005-06-07 21:00:00", "%Y-%m-%d %H:%M:%S")
> (2005, 6, 7, 21, 0, 0, 6, 1, 0)
>  >>> time.localtime()
> (2005, 6, 7, 21, 2, 39, 1, 158, 1)
>  >>>
> 
> 




More information about the Python-list mailing list