module documentation

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``.
Exception 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.
Variable register Undocumented
@register.filter('timezone')
def do_timezone(value, arg): (source)

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.

@register.tag('get_current_timezone')
def get_current_timezone_tag(parser, token): (source)

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.

@register.filter
def localtime(value): (source)

Convert a datetime to local time in the active time zone. This only makes sense within a {% localtime off %} block.

@register.tag('localtime')
def localtime_tag(parser, token): (source)

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 %}

def timezone_constructor(tzname): (source)

Undocumented

@register.tag('timezone')
def timezone_tag(parser, token): (source)

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 %}

@register.filter
def utc(value): (source)

Convert a datetime to UTC.

register = (source)

Undocumented