datetime question

Scott David Daniels scott.daniels at acm.org
Tue Apr 18 18:27:50 EDT 2006


Jorge Godoy wrote:
> Philippe Martin wrote:
> 
>> I need to get the date and time under Windows and Linux but need the
>> information visible to the user (cannot find my words) not the sytem
>> information (ex: a PC setup on greenwich but the date/time displayed are
>> relative to some other place.
> 
> Something like this?
> 
>>>> import datetime
>>>> datetime.datetime.now()
> ...

Just so you (Phillipe) know, you are talking about "local time" vs. UTC.
     >>> import datetime
     >>> print datetime.datetime.now() # local
     2006-04-18 15:25:03.140000
     >>> print datetime.datetime.utcnow() # zulu / utc / gmt
     2006-04-18 22:25:13.625000

--Scott David Daniels
scott.daniels at acm.org



More information about the Python-list mailing list