Posted By

masei on 02/22/07


Tagged

pys60


Versions (?)

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


 / Published in: Python
 

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

  1. >>> import datetime
  2. >>> now = datetime.datetime(2003, 8, 4, 12, 30, 45)
  3. >>> print now
  4. 2003-08-04 12:30:45
  5. >>> print repr(now)
  6. datetime.datetime(2003,8,4,12,30,45)
  7. >>> print type(now)
  8. <type 'instance'>
  9. >>> print now.year, now.month, now.day
  10. 2003 8 4
  11. >>> print now.hour, now.minute, now.second
  12. 12 30 45

Report this snippet  

You need to login to post a comment.