Time
Mike C. Fletcher
mcfletch at rogers.com
Wed Apr 21 15:11:43 EDT 2004
That format is the ISO standard date-time format. The modern way to
work with date-times in Python is to use the datetime module, so:
>>> import datetime
>>> d = datetime.datetime( 2004, 4, 21, 15, 05)
>>> d.isoformat()
'2004-04-21T15:05:00'
You can use datetime.datetime( * mytuple ) to auto-unpack your tuple, btw.
HTH,
Mike
Jonas Galvez wrote:
>If I have a tuple like this:
>
> (year, month, day, hour, minute)
>
>Is there a way to automatically generate a string like this?
>
> "YYYY-MM-DDTHH:MM:00"
>
>I remember seeing something about it somewhere... wanted to be sure.
>
>
...
_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/
More information about the Python-list
mailing list