File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 25
25
26
26
Network Time Protocol (NTP) helper for CircuitPython
27
27
28
-
29
- * Author(s): Brent Rubell
28
+ * Author(s): Brent Rubell
30
29
31
30
Implementation Notes
32
31
--------------------
33
-
34
32
**Hardware:**
35
-
36
33
**Software and Dependencies:**
37
34
38
- * Adafruit CircuitPython firmware for the supported boards:
39
- https://github.com/adafruit/circuitpython/releases
35
+ * Adafruit CircuitPython firmware for the supported boards:
36
+ https://github.com/adafruit/circuitpython/releases
40
37
41
38
"""
42
39
import time
@@ -65,11 +62,14 @@ def set_time(self, tz_offset=0):
65
62
"""Fetches and sets the microcontroller's current time
66
63
in seconds since since Jan 1, 1970.
67
64
68
- :param int tz_offset: Timezone offset from GMT
65
+ :param int tz_offset: The offset of the local timezone,
66
+ in seconds west of UTC (negative in most of Western Europe,
67
+ positive in the US, zero in the UK).
69
68
"""
69
+
70
70
try :
71
71
now = self ._esp .get_time ()
72
- now = time .localtime (now [0 ] + ( tz_offset * 3600 )) # 3600 seconds in an hour
72
+ now = time .localtime (now [0 ] + tz_offset )
73
73
rtc .RTC ().datetime = now
74
74
self .valid_time = True
75
75
except ValueError as error :
You can’t perform that action at this time.
0 commit comments