MCPcopy
hub / github.com/django/django / __init__

Method __init__

django/utils/dateformat.py:56–69  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

54
55class TimeFormat(Formatter):
56 def __init__(self, obj):
57 self.data = obj
58 self.timezone = None
59
60 if isinstance(obj, datetime):
61 # Timezone is only supported when formatting datetime objects, not
62 # date objects (timezone information not appropriate), or time
63 # objects (against established django policy).
64 if is_naive(obj):
65 timezone = get_default_timezone()
66 else:
67 timezone = obj.tzinfo
68 if not _datetime_ambiguous_or_imaginary(obj, timezone):
69 self.timezone = timezone
70
71 def a(self):
72 "'a.m.' or 'p.m.'"

Callers

nothing calls this directly

Calls 3

is_naiveFunction · 0.90
get_default_timezoneFunction · 0.90

Tested by

no test coverage detected