[Python-Dev] Curious datetime method (original) (raw)

Anders Sandvig anders.sandvig at gmail.com
Tue Jul 20 15:57:30 CEST 2010


I wonder why would anyone want to use datetime.today() instead of datetime.now()?

Because this method is also present in datetime.date. Thus, you can reference stuff like d.today().day without caring whether d is a date or a datetime object.

Anders



More information about the Python-Dev mailing list