Change date and time

Changes the device's date and time. The HTTP method used is the POST.

POST /set_system_time.fcgi

Parameters

  • day (int): Numeric value that represents the day of the month.
  • month (int): Numeric value that represents the month of the year. Valid values between 1 and 12.
  • year (int): Numeric value that represents the year. Example: 2022.
  • hour (int): Numeric value that represents the hours. Valid values between 0 and 23.
  • minute (int): Numeric value that represents the minutes. Valid values between 0 and 59.
  • second (int): Numeric value that represents the seconds. Valid values between 0 and 59.

Response

  • This request has no response.

Request example

Changes the date and time to 21:30 12/10/1983:

$.ajax({
    url: "/set_system_time.fcgi?session=" + session,
    type: 'POST',
    contentType: 'application/json',
    data: JSON.stringify({
        day: 10,
        month: 12,
        year: 1983,
        hour: 21,
        minute: 30,
        second: 00
    })
});

NTP support

The Network Time Protocol (NTP) is a protocol used to synchronize computer clocks on a network. It allows computers to obtain the exact time from NTP servers by automatically adjusting their clocks to minimize the time discrepancy between them.

The functionality implemented in the equipment allows the import of "time-zone data" in order to obtain local time zone references. Additionally, it is possible to manually enter daylight saving time (for countries that have adopted the measure).

The module responsible for this configuration is ntp. It can be configured via WEB interface, API or GUI. In it, it is possible to change two parameters: enabled which enables the protocol (values ​​"0" for disabled and "1" for enabled) and timezone which defines the local time (which takes values ​​from "UTC-12" to " UTC+12") in relation to Coordinated Universal Time (UTC).

It is worth mentioning that the NTP protocol supports all devices on the access line, that is, devices with firmware V5 and V6.

Request example

This request enables the ntp protocol with UTC+3:

$.ajax({
    url: "/set_configuration.fcgi?session=" + session,
    type: 'POST',
    contentType: 'application/json',
    data: JSON.stringify(
        {
            "ntp": {
                "enabled": "1",
                "timezone": "UTC+3"
            }
        }
    )
});