set time

Purpose

Sets the Coordinated Universal Time (UTC) and/or system time and date on a Digi device.

If the offset option is set to anything other than 00, this command assumes that if date and time are being set, they are system time.

Out of the box, all Digi devices maintain time and date as the UNIX epoch (00:00:00, January 1, 1970) plus device up-time. On devices with no real‑time clock (RTC), date and time revert to the UNIX epoch on each reboot or power-cycle. On devices with a RTC, date and time is the UNIX epoch plus time since initial power-up.

You can set device time manually using any of the usual human interfaces, such as the command line interface or web interface, or it can be set and maintained using a clock source. See set clocksource.

On a Digi device with no real-time clock and no configured clock source, time and date are completely local to the device and have limited usefulness since they are not persistent over reboots/power-cycles.

On a device with a RTC and no configured clock source, time and date are also local to the device, but they are meaningful because they are persistent. The offset option could be useful in adjusting for daylight savings time. Setting the date and time to standard time and setting offset to 1 whenever daylight savings time is in effect serves that purpose.

On a device with a configured clock source, time and date received from a clock source are expected to be UTC. For users with several devices in different time zones, keeping offset=0 might be useful for comparing logs or traces from different devices, since all would be using UTC.

Required permissions

For Digi products with two or more users, permissions must be set to set permissions s-time-source=read to display current date and time, and to set permissions s-time-source=rw to set the date/time and configure related settings. For devices with a real time clock (RTC), set permissions s‑rtc=rw permissions is required. See set permissions for details on setting user permissions for commands.

Syntax

Configure UTC and/or system time

set time [time={hh:mm:ss|hh:mm}] 
[date=mm.dd.yy]
[offset={hh:mm|hh}]

Display current time and date

set time

Options

time={hh:mm:ss|hh:mm}

The time. Hours can range from 00 to 23, minutes can range from 00 to 59, and seconds can range from 00 to 59. If omitted, all default to 00.

date=mm.dd.yy

The date. Month can range from 01 to 12, day can range from 01 to 28, 29, 30, or 31, depending on the month and leap year, and year can range from 00 to 36, representing the years 2000 through 2036.

offset={hh:mm|hh}

The offset from date and time, in hours and minutes. Offset can range from -12 hours to 14 hours. Very rarely, a time zone can also have an offset in minutes (15, 30, or 45). If minutes are not specified, the default is 00. This value can be used to modify the time and date (generally expected to be UTC) to compensate for time zones and daylight savings time. The offset value is added to internal date and time whenever time is provided by the device.

Example

Set the date and time to 2:15 PM, April 3, 2008

#> set time time=14:15 date=04.03.08

Set the offset for Central Standard Time

#> set time offset=-6

Set the offset for Central Daylight Time

#> set time offset=-5

See also