Undocumented
Variable | register |
Undocumented |
Class | datetimeobject |
Undocumented |
Class | GetCurrentTimezoneNode |
Template node class used by get_current_timezone_tag. |
Class | LocalTimeNode |
Template node class used by localtime_tag. |
Class | TimezoneNode |
Template node class used by timezone_tag. |
Class | UnknownTimezoneException |
Undocumented |
Function | do_timezone |
Convert a datetime to local time in a given time zone. |
Function | get_current_timezone_tag |
Store the name of the current time zone in the context. |
Function | localtime |
Convert a datetime to local time in the active time zone. |
Function | localtime_tag |
Force or prevent conversion of datetime objects to local time, regardless of the value of settings.USE_TZ. |
Function | timezone_constructor |
Undocumented |
Function | timezone_tag |
Enable a given time zone just for this block. |
Function | utc |
Convert a datetime to UTC. |
Convert a datetime to local time in a given time zone.
The argument must be an instance of a tzinfo subclass or a time zone name.
Naive datetimes are assumed to be in local time in the default time zone.
Store the name of the current time zone in the context.
Usage:
{% get_current_timezone as TIME_ZONE %}
This will fetch the currently active time zone and put its name into the TIME_ZONE context variable.
Convert a datetime to local time in the active time zone.
This only makes sense within a {% localtime off %} block.
Force or prevent conversion of datetime objects to local time, regardless of the value of settings.USE_TZ.
Sample usage:
{% localtime off %}{{ value_in_utc }}{% endlocaltime %}
Enable a given time zone just for this block.
The timezone argument must be an instance of a tzinfo subclass, a time zone name, or None. If it is None, the default time zone is used within the block.
Sample usage:
{% timezone "Europe/Paris" %} It is {{ now }} in Paris. {% endtimezone %}