ISO with timezone

Ben Finney bignose+hates-spam at
Wed Jan 30 06:33:23 CET 2008

"Nicholas F. Fabry" <nick.fabry at> writes:

> The constructor for class datetime has a method, .now() that returns
> the current date and time, as a naive datetime object (i.e. no
> tzinfo attached).

It's not "the constructor for class 'datetime'" that has that method;
rather, the class 'datetime' has that method.

(If anything is "the constructor for class 'datetime'", it's the
'__new__' method -- or, some might argue, the '__init__' method -- and
that doesn't fit what you say above.)

> Dates and Times are a bit ugly in Python. Don't be discouraged, but
> you do need to understand them quite well to get bug-free code that
> plays with them.

This is unfortunately true. Native datetime support is improving, but

 \       "[T]he speed of response of the internet will re-introduce us |
  `\    to that from which our political systems have separated us for |
_o__) so long, the consequences of our own actions."  -- Douglas Adams |
Ben Finney

More information about the Python-list mailing list