File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
# date.py Minimal Date class for micropython
2
2
3
3
# Released under the MIT License (MIT). See LICENSE.
4
- # Copyright (c) 2023 Peter Hinch
4
+ # Copyright (c) 2023-2024 Peter Hinch
5
5
6
6
from time import mktime , localtime
7
+ from sys import implementation
8
+ if implementation .name != "micropython" :
9
+ const = lambda x : x
7
10
8
11
_SECS_PER_DAY = const (86400 )
9
12
def leap (year ):
@@ -22,7 +25,7 @@ def now(self, lt=None):
22
25
def _update (self , ltmod = True ): # If ltmod is False ._cur has been changed
23
26
if ltmod : # Otherwise ._lt has been modified
24
27
self ._lt [3 ] = 6
25
- self ._cur = mktime (self ._lt ) // _SECS_PER_DAY
28
+ self ._cur = mktime (tuple ( self ._lt ) ) // _SECS_PER_DAY
26
29
self ._lt = list (localtime (self ._cur * _SECS_PER_DAY ))
27
30
self .callback ()
28
31
You can’t perform that action at this time.
0 commit comments