src/pylib/Lib/datetime_impl/timezone_impl/decl

Source   Edit  

Types

timezone = ref object of tzinfo
  
Source   Edit  
tzinfo = ref object of RootObj
an abstract base class Source   Edit  

Lets

UTC = timezone(offset: timedelta(0, 0, 0, 0, 0, 0, 0))
Source   Edit  

Consts

TzNone: tzinfo = nil
Source   Edit  

Procs

func `$`(self: timezone): string {....raises: [], tags: [], forbids: [].}
timezone_str Source   Edit  
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  
func hash(self: timezone): int {....raises: [], tags: [], forbids: [].}
Source   Edit  
func isTzNone(self: tzinfo): bool {....raises: [], tags: [], forbids: [].}
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  
func offset(self: timezone): timedelta {....raises: [], tags: [], forbids: [].}
inner Source   Edit  
func repr(self: timezone): string {....raises: [], tags: [], forbids: [].}
Source   Edit  

Methods

method repr(self: timezone): string {....raises: [], tags: [], forbids: [].}
timezone_repr Source   Edit  
method repr(self: tzinfo): string {.base, ...raises: [], tags: [], forbids: [].}
object.__repr__ Source   Edit  
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  
template utc(_: NimTimezoneProc): timezone
if import std/times, timezone.utc may matches this. Source   Edit  
template utc(_: typedesc[timezone]): timezone
timezone.utc Source   Edit