getting system date

Tim Heaney heaney at cablespeed.com
Sat May 10 11:22:55 EDT 2003


"Psybar Phreak" <psybar_phreak at yahoo.com> writes:
> 
> im using python cgi in my website, and wanted to get the system date in the
> format YYYY-MM-DD

How about strftime in the time module?

  $ python -c 'import time; print time.strftime("%Y-%m-%d")'
  2003-05-10

I hope this helps,

Tim




More information about the Python-list mailing list