1. Home
  2. Docs
  3. HTTP API of Decoders
  4. 8 Sys-time Module

8 Sys-time Module

Gets time zone and time information

API instruction

Gets time zone and time information of the device

Request

  • Method: GET/POST
  • URL: sys-time/get.json
  • Headers:
  • submit parameter: no

Response

  • Body
{
  "result": "ok",
  "data": {
    "ntp": "ntp1.aliyun.com ntp2.aliyun.com ntp3.aliyun.com",
    "time": "1970-01-01 15:14:00",
    "timetype": "pc",
    "Timezone": "Asia/Shanghai"
  }
}

test interface:

http://192.168.2.123/api/sys-time/get.json

Configure the time

API instruction

configure the location/ time zone and time

Request

  • Method: GET/POST
  • URL: sys-time/modify.json
  • Headers:
  • submit paremeter:
field type instruction
timezone alphabetic string name of time zone。format: Asia/Shanghai
timetype alphabetic string time type,value range:”pc”、”manual”、”ntp”
time alphabetic string current time,please modify the time manually when you know the time and ignorentp parameter
ntp alphabetic string network timing server address

Response

  • Body
{
  "result": "ok"
}

test interface:

#PC timing
http://192.168.2.123/api/sys-time/modify.json?time=2019-11-04%2015:47:25&timetype=pc
#manually
http://192.168.2.123/api/sys-time/modify.json?time=2019-11-04%2015:48:02&timetype=manual
#network
http://192.168.2.123/api/sys-time/modify.json?ntp=ntp1.aliyun.com%20ntp2.aliyun.com%20ntp3.aliyun.com&timetype=ntp
#modify time zone
http://192.168.2.123/api/sys-time/modify.json?timezone=Asia/Chongqing&offset=8

How can we help?