File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change 22
22
"""
23
23
`adafruit_ntp`
24
24
================================================================================
25
-
26
25
Network Time Protocol (NTP) helper for CircuitPython
27
-
28
-
29
26
* Author(s): Brent Rubell
30
-
31
27
Implementation Notes
32
28
--------------------
33
-
34
29
**Hardware:**
35
-
36
30
**Software and Dependencies:**
37
-
38
31
* Adafruit CircuitPython firmware for the supported boards:
39
32
https://github.com/adafruit/circuitpython/releases
40
-
41
33
"""
42
34
import time
43
35
import rtc
49
41
class NTP :
50
42
"""Network Time Protocol (NTP) helper module for CircuitPython.
51
43
This module does not handle daylight savings or local time.
52
-
53
44
:param adafruit_esp32spi esp: ESP32SPI object.
54
45
"""
55
46
@@ -64,12 +55,11 @@ def __init__(self, esp):
64
55
def set_time (self , tz_offset = 0 ):
65
56
"""Fetches and sets the microcontroller's current time
66
57
in seconds since since Jan 1, 1970.
67
-
68
58
:param int tz_offset: The offset of the local timezone,
69
59
in seconds west of UTC (negative in most of Western Europe,
70
60
positive in the US, zero in the UK).
71
61
"""
72
-
62
+
73
63
try :
74
64
now = self ._esp .get_time ()
75
65
now = time .localtime (now [0 ] + tz_offset )
You can’t perform that action at this time.
0 commit comments