Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions hermes_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ def get_timezone() -> Optional[ZoneInfo]:
return _cached_tz


def reset_cache() -> None:
"""Clear the cached timezone so the next call re-resolves it."""
global _cached_tz, _cached_tz_name, _cache_resolved
_cached_tz = None
_cached_tz_name = None
_cache_resolved = False


def now() -> datetime:
"""
Return the current time as a timezone-aware datetime.
Expand Down