You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`timezone` a string representing timezone, can also include DST adjustment. For full syntax see [TZ variable documentation](http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html).
91
-
92
-
#### Returns
93
-
`nil`
94
-
95
-
#### Example
96
-
```lua
97
-
--set timezone to Eastern Standard Time
98
-
time.settimezone("EST+5")
99
-
```
100
-
101
130
## time.initntp()
102
-
Initializes and starts ntp client
131
+
Initializes and starts NTP client
103
132
104
133
#### Syntax
105
134
`time.initntp([ntpAddr])`
106
135
107
136
#### Parameters
108
-
-`ntpAddr` address of a ntp server, defaults to "pool.ntp.org" if none is specified
137
+
-`ntpAddr` address of a NTP server, defaults to "pool.ntp.org" if none is specified
109
138
110
139
#### Returns
111
140
`nil`
@@ -115,8 +144,9 @@ Initializes and starts ntp client
115
144
time.initntp("pool.ntp.org")
116
145
```
117
146
147
+
118
148
## time.ntpenabled()
119
-
Checks if ntp client is enabled.
149
+
Checks if NTP client is enabled.
120
150
121
151
#### Syntax
122
152
`time.ntpenabled()`
@@ -125,10 +155,11 @@ Checks if ntp client is enabled.
125
155
none
126
156
127
157
#### Returns
128
-
`true' if ntp client is enabled.
158
+
`true' if NTP client is enabled.
159
+
129
160
130
161
## time.ntpstop()
131
-
Stops ntp client.
162
+
Stops NTP client.
132
163
133
164
#### Syntax
134
165
`time.ntpstop()`
@@ -139,68 +170,43 @@ none
139
170
#### Returns
140
171
`nil`
141
172
142
-
## time.epoch2cal()
143
-
Converts timestamp in Unix epoch to calendar format
173
+
174
+
## time.set()
175
+
Sets system time to a given timestamp in the Unix epoch (seconds from midnight 1970/01/01).
144
176
145
177
#### Syntax
146
-
`time.epoch2cal(time)
178
+
`time.set(time)`
147
179
148
180
#### Parameters
149
181
-`time` number of seconds since the Epoch
150
182
151
183
#### Returns
152
-
A table containing the fields:
153
-
154
-
-`year` 1970 ~ 2038
155
-
-`mon` month 1 ~ 12 in current year
156
-
-`day` day 1 ~ 31 in current month
157
-
-`hour`
158
-
-`min`
159
-
-`sec`
160
-
-`yday` day 1 ~ 366 in current year
161
-
-`wday` day 1 ~ 7 in current weak (Sunday is 1)
162
-
-`dst` day time adjustment:
163
-
- 1 (DST in effect, i.e. daylight time)
164
-
- 0 (DST not in effect, i.e. standard time)
165
-
- -1 (Unknown DST status)
184
+
`nil`
166
185
167
186
#### Example
168
187
```lua
169
-
--Gets current time calendar format, no locale adjustment
Converts calendar table to a timestamp in Unix epoch
192
+
#### See also
193
+
[`time.cal2epoc()`](#timecal2epoch)
194
+
195
+
196
+
## time.settimezone()
197
+
Sets correct format for Time Zone locale
176
198
177
199
#### Syntax
178
-
`time.cal2epoch(calendar)`
200
+
`time.settimezone(timezone)`
179
201
180
202
#### Parameters
181
-
-`calendar` Table containing calendar info.
182
-
-`year` 1970 ~ 2038
183
-
-`mon` month 1 ~ 12 in current year
184
-
-`day` day 1 ~ 31 in current month
185
-
-`hour`
186
-
-`min`
187
-
-`sec`
203
+
-`timezone` a string representing timezone, can also include DST adjustment. For full syntax see [TZ variable documentation](http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html).
0 commit comments