[Python-Dev] Curious datetime method (original) (raw)
Anders Sandvig anders.sandvig at gmail.com
Tue Jul 20 15:57:30 CEST 2010
- Previous message: [Python-Dev] Curious datetime method
- Next message: [Python-Dev] Curious datetime method
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] Curious datetime method
- Next message: [Python-Dev] Curious datetime method
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]