datetime question

Ben Finney ben+python at benfinney.id.au
Fri Oct 30 19:08:17 EDT 2009


Victor Subervi <victorsubervi at gmail.com> writes:

> What I need to calculate is the length of days in the given month. How
> do I do that?

The ‘datetime’ module focusses on individual date+time values (and the
periods between them, with the ‘timedelta’ type).

For querying the properties of the calendar, use the ‘calendar’ module.

Yes, it would be nice if the ‘time’, ‘datetime’, and ‘calendar’ modules
were all much more unified and consumed a common set of primitive
date+time types. It's a wart, and fixing it would (unfortunately)
probably require backward-incompatible API changes.

-- 
 \            “Simplicity is prerequisite for reliability.” —Edsger W. |
  `\                                                          Dijkstra |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list