time module methods give an am or pm value ?

Mark Tolonen M8R-yfto6h at mailinator.com
Sat Jun 7 10:24:57 EDT 2008


"dj" <d.a.abernathy at gmail.com> wrote in message 
news:2309efff-5c6b-4434-a2cd-01c3fee86fee at l42g2000hsc.googlegroups.com...
> Hello again,
>
> Does anyone know which method in the time module will generate and am
> or pm ?
> If none of the method will do this for me. Can I produce the value on
> my own ?
> Any suggestions ?

>>> from time import *
>>> strftime('%I:%M:%S %p',localtime(time()))
'07:23:24 AM'
>>> strftime('%I:%M:%S %p',gmtime(time()))
'02:23:39 PM'

-Mark 




More information about the Python-list mailing list