Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility for Django's timezone.now() #5

Open
jdotjdot opened this issue Jul 6, 2015 · 0 comments
Open

Add compatibility for Django's timezone.now() #5

jdotjdot opened this issue Jul 6, 2015 · 0 comments

Comments

@jdotjdot
Copy link
Owner

jdotjdot commented Jul 6, 2015

When timezone.now() is available, t() should default to using it.

There should be settings on the t class to (a) make times timezone-aware, and (b) choose the timezone for all dates/times to be output in.

Note that this won't be too difficult given that you can simply get the current time at a specific timezone doing something like the following:

import datetime
import pytz
>>> datetime.datetime.now(pytz.timezone('US/Eastern'))
datetime.datetime(2015, 7, 6, 16, 46, 18, 246759, tzinfo=<DstTzInfo 'US/Eastern' EDT-1 day, 20:00:00 DST>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant