Function | activate |
Set the time zone for the current thread. |
Function | deactivate |
Unset the time zone for the current thread. |
Function | get_current_timezone |
Return the currently active time zone as a tzinfo instance. |
Function | get_current_timezone_name |
Return the name of the currently active time zone. |
Function | get_default_timezone |
Return the default time zone as a tzinfo instance. |
Function | get_default_timezone_name |
Return the name of the default time zone. |
Function | get_fixed_timezone |
Return a tzinfo instance with a fixed offset from UTC. |
Function | is_aware |
Determine if a given datetime.datetime is aware. |
Function | is_naive |
Determine if a given datetime.datetime is naive. |
Function | localdate |
Convert an aware datetime to local time and return the value's date. |
Function | localtime |
Convert an aware datetime.datetime to local time. |
Function | make_aware |
Make a naive datetime.datetime in a given time zone aware. |
Function | make_naive |
Make an aware datetime.datetime naive in a given time zone. |
Function | now |
Return an aware or naive datetime.datetime, depending on settings.USE_TZ. |
Constant | NOT_PASSED |
Undocumented |
Class | override |
Temporarily set the time zone for the current thread. |
Function | _datetime_ambiguous_or_imaginary |
Undocumented |
Function | _get_timezone_name |
Return the offset for fixed offset timezones, or the name of timezone if not set. |
Function | _is_pytz_zone |
Checks if a zone is a pytz zone. |
Function | _pytz_imported |
Detects whether or not pytz has been imported without importing pytz. |
Function | template_localtime |
Check if value is a datetime and converts it to local time if necessary. |
Constant | _PYTZ_IMPORTED |
Undocumented |
Variable | _active |
Undocumented |
Set the time zone for the current thread.
The timezone argument must be an instance of a tzinfo subclass or a time zone name.
Unset the time zone for the current thread.
Django will then use the time zone defined by settings.TIME_ZONE.
Return the default time zone as a tzinfo instance.
This is the time zone defined by settings.TIME_ZONE.
Determine if a given datetime.datetime is aware.
The concept is defined in Python's docs: https://docs.python.org/library/datetime.html#datetime.tzinfo
Assuming value.tzinfo is either None or a proper datetime.tzinfo, value.utcoffset() implements the appropriate logic.
Determine if a given datetime.datetime is naive.
The concept is defined in Python's docs: https://docs.python.org/library/datetime.html#datetime.tzinfo
Assuming value.tzinfo is either None or a proper datetime.tzinfo, value.utcoffset() implements the appropriate logic.
Convert an aware datetime to local time and return the value's date.
Only aware datetimes are allowed. When value is omitted, it defaults to now().
Local time is defined by the current time zone, unless another time zone is specified.
Convert an aware datetime.datetime to local time.
Only aware datetimes are allowed. When value is omitted, it defaults to now().
Local time is defined by the current time zone, unless another time zone is specified.
Detects whether or not pytz has been imported without importing pytz.
Copied from pytz_deprecation_shim with thanks to Paul Ganssle.
Check if value is a datetime and converts it to local time if necessary.
If use_tz is provided and is not None, that will force the value to be converted (or not), overriding the value of settings.USE_TZ.
This function is designed for use by the template engine.