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])
| 581 | |
| 582 | |
| 583 | def _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 | |
| 595 | def extract_contents(data_dir, content_to_manpages, content_to_released, output_dir): |