kopia lustrzana https://github.com/micropython/micropython-lib
time: Add dummy struct_time constructor.
CPython compatibility. As we don't have a proper struct_time, and use tuple instead, the constructor is identity function.pull/121/merge
rodzic
f51d7ec0db
commit
50ae5ef4aa
|
@ -25,6 +25,9 @@ def _c_tm_to_tuple(tm):
|
|||
t = ustruct.unpack("@iiiiiiiii", tm)
|
||||
return tuple([t[5] + 1900, t[4] + 1, t[3], t[2], t[1], t[0], (t[6] - 1) % 7, t[7] + 1, t[8]])
|
||||
|
||||
def struct_time(tm):
|
||||
return tm
|
||||
|
||||
|
||||
def strftime(format, t=None):
|
||||
if t is None:
|
||||
|
|
Ładowanie…
Reference in New Issue