MCPcopy Create free account
hub / github.com/ActiveState/code / ToTimeTuple

Method ToTimeTuple

recipes/Python/117215_A_Date_module/recipe-117215.py:260–267  ·  view source on GitHub ↗

Convert a date into a time tuple (time module) corresponding to the same day with the midnight hour.

(self)

Source from the content-addressed store, hash-verified

258
259 #Conversion methods.
260 def ToTimeTuple(self):
261 """Convert a date into a time tuple (time module) corresponding to the
262 same day with the midnight hour."""
263 ret = [self.year, self.month, self.day]
264 ret.extend([0, 0, 0])
265 ret.append(self.weekday())
266 ret.extend([self.GetYearDay(), 0])
267 return tuple(ret)
268
269 def ToUnixTime(self):
270 """Convert a date into Unix time (seconds since the epoch) corresponding

Callers 1

ToUnixTimeMethod · 0.95

Calls 4

weekdayMethod · 0.95
GetYearDayMethod · 0.95
extendMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected