This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients
Date 2004-05-26.19:32:50
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=31435

Under the belief that the *intent* of this patch is to add a C 
API to Python's datetime module, it should stick to exposing C 
ways to spell what Python programmers can already do from 
Python using datetime.  Since nothing like TimeFromTicks() 
exists in the Python datetime API, it simply doesn't make 
sense to invent one available only from C.  It *may* make 
sense to invent one in a DB API wrapper around datetime, but 
I view that as out of scope for this patch.

I would not add TimeFromTicks() to the Python datetime API 
either, because the docs are ambiguous.  The sample 
implementation Marc-Andre posted here uses localtime() to 
resolve the ambiguity in the docs, but that has to be a wrong 
choice for some time-of-day apps.  For example, there's 
apparently no portable way to spell "noon" using 
TimeFromTicks():  the value you get back depends on which 
time zone localtime() happens to use at the time it's called.

If people want time-of-day from a POSIX timestamp, it 
remains easy to get it from what datetime already supplies, 
but to do so you have to be explicit about whether you want 
UTC or local time interpretation.  Both are easily spelled 
already, and it's a Good Thing that you need to be explicit if 
you want to do such a thing.
History
Date User Action Args
2007-08-23 15:31:57adminlinkissue876130 messages
2007-08-23 15:31:57admincreate