Control object for setting the date and time
Commands sent to the /pps/services/clock/control object are of the form:
msg::command_string\nid::ID_number\ndat:json:{JSON_data}
Responses always reflect the command_string and ID_number that were sent in the message, along with any errors:
res::command_string\nid::ID_number\ndat:json:{JSON_data}\nerr::errno_number\nerrstr::error_description
This object accepts only one command:
msg:: | id:: | dat:json: |
---|---|---|
set | Number | {"parameter":"value", "parameter":"value", ...} (see below) |
Parameters and values are as follows:
Parameter | Value |
---|---|
year | 1970-9999 |
month | 1-12 |
day | 1-31
Note:
The set command doesn't completely validate input. For example, if you enter a month and day of "2":"31" (February 31), the set command will pass this input to the date command-line utility, which will reject it, but set won't report the error back to you. Remember to sanitize your input.
|
hour | 0-24 |
minute | 0-59 |
second | 0-60 |
res:: | id:: | dat:json: | err:: | errstr:: |
---|---|---|---|---|
set | Number (whatever was sent in id::) | n/a | errno_number | as appropriate |