Return the default time zone as a tzinfo instance. This is the time zone defined by settings.TIME_ZONE.
()
| 44 | # wrap the logic in a function and cache the result. |
| 45 | @functools.lru_cache |
| 46 | def get_default_timezone(): |
| 47 | """ |
| 48 | Return the default time zone as a tzinfo instance. |
| 49 | |
| 50 | This is the time zone defined by settings.TIME_ZONE. |
| 51 | """ |
| 52 | return zoneinfo.ZoneInfo(settings.TIME_ZONE) |
| 53 | |
| 54 | |
| 55 | # This function exists for consistency with get_current_timezone_name |
no outgoing calls