Delorean – datetime conversions in Python
21–30 of 42 posts
Re: Delorean – datetime conversions in Python
#22Slightly off topic: does anybody know why timezones are not firmly isolated within the presentation layer (more specifically, in the string formatting functions) rather than being part of the datetime object? (datetime in Python, DateTime in C#). In other words why this sentence could be wrong: Timezones are a presentation-layer problem! http://news.ycombinator.com/item?id=5083321
Sibling response has already covered the direct answer, so I'll give an indirect one: http://infiniteundo.com/post/25326999628/falsehoods-programm...
Re: Delorean – datetime conversions in Python
#23Earlier quoted context omitted.
Sibling response has already covered the direct answer, so I'll give an indirect one: http://infiniteundo.com/post/25326999628/falsehoods-programm...
And which of those falsehoods applies here? I might be a bit thick, but just stating the falsehoods does not imply that our base temporal objects should be full of presentational properties. Or does it?
Re: Delorean – datetime conversions in Python
#24Slightly off topic: does anybody know why timezones are not firmly isolated within the presentation layer (more specifically, in the string formatting functions) rather than being part of the datetime object? (datetime in Python, DateTime in C#). In other words why this sentence could be wrong: Timezones are a presentation-layer problem! http://news.ycombinator.com/item?id=5083321
Re: Delorean – datetime conversions in Python
#25First, I'd like to encourage the author - please keep iterating and keep the functionality coming. There is certainly a lot that can be done to make working with dates easier. That said, this is just not very impressive right now. The dateutil module is much more useful: http://labix.org/python-dateutil
I appreciate the encouragement. What would be much more useful is some actual feedback. :) I have baked in some of the niceties of dateutil into Delorean, such as rrule and parse.
Re: Delorean – datetime conversions in Python
#26Earlier quoted context omitted.
I appreciate the encouragement. What would be much more useful is some actual feedback. :) I have baked in some of the niceties of dateutil into Delorean, such as rrule and parse.
Please don't make it too much like dateutil; using that module requires too much doc study. I usually end up just building a few functions from scratch that do precisely what I want with datetime alone.
Re: Delorean – datetime conversions in Python
#27Re: Delorean – datetime conversions in Python
#28Earlier quoted context omitted.
Sibling response has already covered the direct answer, so I'll give an indirect one: http://infiniteundo.com/post/25326999628/falsehoods-programm...
And which of those falsehoods applies here? I might be a bit thick, but just stating the falsehoods does not imply that our base temporal objects should be full of presentational properties. Or does it?
The point is actually that it's not presentational at all. Time is far, far more complicated than your link implies; just read the comments in the HN thread: they're full of explanations for why it's oversimplifying.
Also, see: http://en.wikipedia.org/wiki/Time_standard
The essential problem comes down to the assumption that "a second" is a well-defined unit of measurement. The Wikipedia article sums it up nicely.
For applications like the vast majority of customer-facing web stuff? We rarely care about anything more precise than a minute, if that. It makes sense to isolate stuff into the presentation layer here, since the backend generally deals in milliseconds for logging anyways. But you can't generalize "customer-facing web stuff" into "anything a general purpose programming language might be used for": some of those things really care about the exactness of time and a specific time standard.
Re: Delorean – datetime conversions in Python
#29This is very similar to Arrow. Take a look at the arrow project: https://github.com/crsmithdev/arrow You guys did almost the same sort of thing. Maybe I'm wrong and you've enhanced the functionality set even more but it could be very well worth your efforts to combine forces.
Re: Delorean – datetime conversions in Python
#30Earlier quoted context omitted.
> but calling 'Delorean' to convert times is totally obscure Unlike calling 'pickle' to serialize...
Although now we make and eat pickled vegetables because we like the taste, pickling was originally developed in order to enable vegetables to store longer. Calling a serializer "pickle" isn't unreasonable.