Skip to main content

override

Temporarily set the time zone for the current thread.

Attributes

AttributeTypeDescription
timezonetzinfo, str, or NoneThe time zone to be activated, which must be an instance of a tzinfo subclass, a time zone name, or None to enable the default time zone.
old_timezonetzinfo, str, or NoneStores the previously active time zone captured upon entering the context to ensure it can be restored on exit.

Constructor

Signature

def override(
timezone: [Union](../../contrib/gis/db/models/functions/union.md?sid=django_contrib_gis_db_models_functions_union)[tzinfo, str, None]
) - > null

Parameters

NameTypeDescription
timezone[Union](../../contrib/gis/db/models/functions/union.md?sid=django_contrib_gis_db_models_functions_union)[tzinfo, str, None]An instance of a tzinfo subclass, a time zone name, or None to enable the default time zone.

Signature

def override(
timezone: tzinfo|str|None
) - > null

Parameters

NameTypeDescription
timezone`tzinfostr