Skip to content
Alberto Gonzalez edited this page Jun 19, 2017 · 2 revisions

(GET)/date-time

Description

Returns the date/time, timezone, and NTP server configuration for the specified system.

Request

Syntax

GET /api/date-time/?sid={sid}
Host: <server host name>
Accept: application/json
AuthToken: <authentication token returned from authenticate>

Parameters

Optional filters include:

Response

200 success

Parameters

Index Value Type Returned
year current year long always
month current month long always
day current day long always
hour current hour long always
minute current minute long always
second current second long always
tz current timezone string always
tzOffset offset in seconds from GMT int always
ntp array of ntp settings array always (empty if not defined)

The NTP array returned is:

Index Value Type Returned
enabled using NTP boolean always
local is local time source being used? boolean always
sync sync clock with ntp server before starting ntpd or not boolean always
servers array of ntp servers as strings array of strings always (empty if none defined)

Examples

Sample Request

GET /api/date-time/?sid=1
Host: <server host name>
Accept: application/json
AuthToken: 8a00sjerhterqerjlqkjlk443l4j56869h4f_)(fjdkasHHHHHkdal324

Sample Response


{
    "year": 2014,
    "month": 9,
    "day": 26,
    "hour": 4,
    "minute": 26,
    "second": 4,
    "tz": "Australia/Adelaide",
    "ntp": {
        "enabled": true,
        "local": true,
        "sync": false,
        "server": [
            "0.centos.pool.ntp.org",
            "1.centos.pool.ntp.org",
            "2.centos.pool.ntp.org"
        ]
    }
}

Clone this wiki locally