3 ms·
Not being a Pythonista, I have the following questions: 1) Is there a (native or custom) date type in Python? Is it an object? 2) Midnight when? Today? This d
by delinka 13y ago
Not being a Pythonista, I have the following questions:
1) Is there a (native or custom) date type in Python? Is it an object?
2) Midnight when? Today? This date last year? Sure there's a "zero value" for dates - it's the epoch for whichever platform or library you're using.
3) Why in would anyone call it a "date" if it's really a time?
Maybe I'm getting off into the philosophical decisions of the reptile wranglers, but this particular debate sounds a lot like someone made a decision long ago that had ramifications further than expected and now the justification is engrained, things are built on it, and no one's willing to make the 'correction.'
- mildtrepidation 13y agoPython has dates, times, and datetimes[0]. They're all objects. So yes, you could get around this by always using a datetime. However, sometimes what you need is just a time. [0] http://docs.python.org/2/library/datetime.html http://docs.python.org/2/library/datetime.html
- donaldstufft 13y agoIt's midnight without a date, however if there is a timezone attached to the time then it's midnight utc unless the utc offset of the time is a negative value, then it's never.
- maxerickson 13y agoThe second paragraph of the link contains "datetime.time(0,0,0)". I can understand not wanting to make many inferences, but that sort of answers your questions.