Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: How to Format Dates and Times

Python: How to Format Dates and Times

import time
now = time.localtime(time.time())
print time.asctime(now)
print time.strftime("%y/%m/%d %H:%M", now)
print time.strftime("%c", now)
print time.strftime("%a %b %d", now)
print time.strftime("%d", now)
print time.strftime("%I %p", now)
print time.strftime("%Y-%m-%d %H:%M:%S %Z", now)

Users who found this page were searching for:

  • python format time locale french
  • time.asctime() date difference python
  • time.asctime format
  • time asctime format
  • dateformatter format python now()
  • python time.asctime() format

No comments yet.

Leave a Comment