Return to Snippet

Revision: 2457
at February 22, 2007 18:23 by masei


Initial Code
>>> import datetime
>>> now = datetime.datetime(2003, 8, 4, 12, 30, 45)
>>> print now
2003-08-04 12:30:45
>>> print repr(now)
datetime.datetime(2003,8,4,12,30,45)
>>> print type(now)
<type 'instance'>
>>> print now.year, now.month, now.day
2003 8 4
>>> print now.hour, now.minute, now.second
12 30 45

Initial URL
http://snippets.dzone.com/posts/show/1614

Initial Description

                                

Initial Title
Using datetime in python 2.2 (e.g. pys60) [date] [python] [series60] [time] [datetime] [pys60] [compatible]

Initial Tags

                                

Initial Language
Python