MCPcopy Create free account
hub / github.com/idank/explainshell / _released_to_epoch

Function _released_to_epoch

tools/fetch_manned.py:583–592  ·  view source on GitHub ↗

Convert a (YYYY, MM, DD) tuple to UTC epoch seconds. Missing dates (0, 0, 0) collapse to 0, matching the gzip ``mtime=0`` convention for "no timestamp available".

(released: tuple[int, int, int])

Source from the content-addressed store, hash-verified

581
582
583def _released_to_epoch(released: tuple[int, int, int]) -> int:
584 """Convert a (YYYY, MM, DD) tuple to UTC epoch seconds.
585
586 Missing dates (0, 0, 0) collapse to 0, matching the gzip ``mtime=0``
587 convention for "no timestamp available".
588 """
589 y, m, d = released
590 if y == 0:
591 return 0
592 return calendar.timegm((y, m, d, 0, 0, 0, 0, 0, 0))
593
594
595def extract_contents(data_dir, content_to_manpages, content_to_released, output_dir):

Callers 1

extract_contentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected