MCPcopy
hub / github.com/tortoise/tortoise-orm / _init_timezone

Method _init_timezone

tortoise/context.py:370–377  ·  view source on GitHub ↗

Initialize timezone settings for this context.

(self, use_tz: bool, timezone: str)

Source from the content-addressed store, hash-verified

368 set_global_context(self)
369
370 def _init_timezone(self, use_tz: bool, timezone: str) -> None:
371 """Initialize timezone settings for this context."""
372 self._use_tz = use_tz
373 self._timezone = timezone
374 # Set environment variables for backward compatibility
375 os.environ["USE_TZ"] = str(use_tz)
376 os.environ["TIMEZONE"] = timezone
377 _reset_timezone_cache()
378
379 def _init_routers(self, routers: list[str | type] | None = None) -> None:
380 """Initialize database routers for this context."""

Callers 1

initMethod · 0.95

Calls 1

_reset_timezone_cacheFunction · 0.90

Tested by

no test coverage detected