Unrelated but handy function to calculate Unix timestamp from GMT.
(tuple)
| 832 | |
| 833 | |
| 834 | def timegm(tuple): |
| 835 | """Unrelated but handy function to calculate Unix timestamp from GMT.""" |
| 836 | year, month, day, hour, minute, second = tuple[:6] |
| 837 | days = datetime.date(year, month, 1).toordinal() - _EPOCH_ORD + day - 1 |
| 838 | hours = days*24 + hour |
| 839 | minutes = hours*60 + minute |
| 840 | seconds = minutes*60 + second |
| 841 | return seconds |
| 842 | |
| 843 | |
| 844 | def main(args=None): |
no test coverage detected
searching dependent graphs…