- `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).
#### Returns
`nil`
#### Example
```lua
--set timezone to Eastern Standard Time
time.settimezone("EST+5")
```
## time.initntp()
Initializes and starts ntp client
Initializes and starts NTP client
#### Syntax
`time.initntp([ntpAddr])`
#### Parameters
- `ntpAddr` address of a ntp server, defaults to "pool.ntp.org" if none is specified
- `ntpAddr` address of a NTP server, defaults to "pool.ntp.org" if none is specified
#### Returns
`nil`
...
...
@@ -115,8 +144,9 @@ Initializes and starts ntp client
time.initntp("pool.ntp.org")
```
## time.ntpenabled()
Checks if ntp client is enabled.
Checks if NTP client is enabled.
#### Syntax
`time.ntpenabled()`
...
...
@@ -125,10 +155,11 @@ Checks if ntp client is enabled.
none
#### Returns
`true' if ntp client is enabled.
`true' if NTP client is enabled.
## time.ntpstop()
Stops ntp client.
Stops NTP client.
#### Syntax
`time.ntpstop()`
...
...
@@ -139,68 +170,43 @@ none
#### Returns
`nil`
## time.epoch2cal()
Converts timestamp in Unix epoch to calendar format
## time.set()
Sets system time to a given timestamp in the Unix epoch (seconds from midnight 1970/01/01).
#### Syntax
`time.epoch2cal(time)
`time.set(time)`
#### Parameters
-`time` number of seconds since the Epoch
#### Returns
A table containing the fields:
- `year` 1970 ~ 2038
- `mon` month 1 ~ 12 in current year
- `day` day 1 ~ 31 in current month
- `hour`
- `min`
- `sec`
- `yday` day 1 ~ 366 in current year
- `wday` day 1 ~ 7 in current weak (Sunday is 1)
- `dst` day time adjustment:
- 1 (DST in effect, i.e. daylight time)
- 0 (DST not in effect, i.e. standard time)
- -1 (Unknown DST status)
`nil`
#### Example
```lua
--Gets current time calendar format, no locale adjustment
Converts calendar table to a timestamp in Unix epoch
#### See also
[`time.cal2epoc()`](#timecal2epoch)
## time.settimezone()
Sets correct format for Time Zone locale
#### Syntax
`time.cal2epoch(calendar)`
`time.settimezone(timezone)`
#### Parameters
- `calendar` Table containing calendar info.
- `year` 1970 ~ 2038
- `mon` month 1 ~ 12 in current year
- `day` day 1 ~ 31 in current month
- `hour`
- `min`
- `sec`
-`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).