mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 21:22:36 +01:00
Add docstring to supybot.utils.time.iana_timezone
This commit is contained in:
parent
12c526bc1c
commit
feaa02ab6d
@ -53,6 +53,14 @@ class UnknownTimeZone(TimezoneException):
|
||||
pass
|
||||
|
||||
def iana_timezone(name):
|
||||
"""Returns a :class:datetime.tzinfo object, given an IANA timezone name,
|
||||
eg. ``"Europe/Paris"``.
|
||||
|
||||
This uses :class:``zoneinfo.ZoneInfo`` if available,
|
||||
:func:``pytz.timezone`` otherwise.
|
||||
|
||||
May raise instances of :exc:`TimezoneException`.
|
||||
"""
|
||||
if not _IANA_TZ_RE.match(name):
|
||||
raise UnknownTimeZone(name)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user