Procs
func format_utcoffset(parts: DurationParts; sep: string | char = ':'; prefix = "UTC"): string
- common code of CPython C-API timezone_str and format_utcoffset in _datetimemodule.c Source Edit
proc newPyTimezone(offset: timedelta): timezone {....raises: [ValueError], tags: [], forbids: [].}
- Source Edit
func newPyTimezone(offset: timedelta; name: string): timezone {. ...raises: [ValueError], tags: [], forbids: [].}
- Source Edit
Methods
method toNimTimezone(self: timezone): Timezone {....raises: [], tags: [], forbids: [].}
-
Warning: in Nim, method's self cannot be nil, otherwise a NilAccessDefect will occur. use tzToNimTimezone as a workaround.Source Edit
method toNimTimezone(self: tzinfo): Timezone {.base, ...raises: [], tags: [], forbids: [].}
-
Warning: in Nim, method's self cannot be nil, otherwise a NilAccessDefect will occur. use tzToNimTimezone as a workaround.Source Edit
Templates
template tzToNimTimezone(tz: tzinfo): Timezone
- EXT. if tz.isTzNone: local() else: tz.toNimTimezone as when tz is None, a.k.a. dispatcher is nil, toNimTimezone will fail when called, raising NilAccessDefect Source Edit