Skip to content

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

@jdotjdot

Description

@jdotjdot

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>)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions