Delorean – datetime conversions in Python
delorean.readthedocs.org
Delorean – datetime conversions in Python
1–10 of 42 posts
Re: Delorean – datetime conversions in Python
#2Re: Delorean – datetime conversions in Python
#3From the docs looks like a quality solution to a real faff in python. Kudos.
So I welcome any feedback people may have :)
Re: Delorean – datetime conversions in Python
#4`return utc.localize(datetime.utcnow()).astimezone(est)` is maybe a little annoying to type out, but it's obvious what it does. `return Delorean(est)` doesn't make any sense at all.
Re: Delorean – datetime conversions in Python
#5In 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
#6I'm not a fan of the name (or the entire syntax really, but the non-descriptive name is the worst bit). python is generally pretty self-documenting, but calling 'Delorean' to convert times is totally obscure. using datetime and pytz.timezone is a few too many steps at times, but at least it is readable. This is just magic. `return utc.localize(datetime.utcnow()).astimezone(est)` is maybe a little annoying to type out…
I would take a look at the docs and see what else the library can provide before you start quoting the interface incorrectly. :)
As for the name I considered other things most lead to namespace pollution. You are right I might be able to clear up the reference for people who dont know "Back to the Future" series.
Re: Delorean – datetime conversions in Python
#7That said, this is just not very impressive right now. The dateutil module is much more useful: http://labix.org/python-dateutil
Re: Delorean – datetime conversions in Python
#8Re: Delorean – datetime conversions in Python
#9First, 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 have baked in some of the niceties of dateutil into Delorean, such as rrule and parse.
Re: Delorean – datetime conversions in Python
#10Every time I do something involving with timezones in Python I find myself having to figure out the API again from scratch - it just doesn't fit in my brain. Having read the docs for this it appears to cover everything I ever want to do in a much more obvious way. Thanks very much!