MCPcopy Create free account
hub / github.com/dateutil/dateutil / _tzstr_header

Function _tzstr_header

tests/test_tzfile.py:271–285  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

269
270@functools.cache
271def _tzstr_header():
272 out = bytearray()
273 # The TZif format always starts with a Version 1 file followed by
274 # the Version 2+ file. In this case, we have no transitions, just
275 # the tzstr in the footer, so up to the footer, the files are
276 # identical and we can just write the same file twice in a row.
277 for _ in range(2):
278 out += b"TZif" # Magic value
279 out += b"3" # Version
280 out += b" " * 15 # Reserved
281
282 # We will not write any of the manual transition parts
283 out += struct.pack(">6l", 0, 0, 0, 0, 0, 0)
284
285 return bytes(out)
286
287
288def zone_from_tzstr(tzstr, encoding="ascii"):

Callers 1

zone_from_tzstrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected