Date & Time
None
None
"devices": { "CurrentDateTime": { "protocol": [ "datetime" ], "id": [{ "longitude": 1.2345, "latitude": 12.3456 }], "year": 2015, "month": 1, "day": 27, "hour": 14, "minute": 37, "second": 8, "weekday": 3, "dst": 1 } }, "gui": { "CurrentDateTime": { "name": "Date & Time", "group": [ "Misc" ], "media": [ "all" ] } }
GUI settings
Setting | Default | Format | Description |
---|---|---|---|
show-datetime | 1 | 1 or 0 | Don't display the datetime values |
format | HH:mm:ss YYYY-MM-DD | see below | Datetime formatting |
Input | Output |
---|---|
M, MM | Month Number (1 - 12) |
MMM, MMMM | Month Name (In currently language set by moment.lang()) |
D, DD | Day of month |
DDD, DDDD | Day of year |
d, dd, ddd, dddd | Day of week (NOTE: these formats only make sense when combined with “ww”) |
e | Day of week (locale) (NOTE: these formats only make sense when combined with “ww”) |
E | Day of week (ISO) (NOTE: this format only make sense when combined with “WW”) |
w, ww | Week of the year (NOTE: combine this format with “gg” or “gggg” instead of “YY” or “YYYY”) |
W, WW | Week of the year (NOTE: combine this format with “GG” or “GGGG” instead of “YY” or “YYYY”) |
YY | 2 digit year (if greater than 68 will return 1900's, otherwise 2000's) |
YYYY | 4 digit year |
gg | 2 digit week year (if greater than 68 will return 1900's, otherwise 2000's) |
gggg | 4 digit week year |
GG | 2 digit week year (ISO) (if greater than 68 will return 1900's, otherwise 2000's) |
GGGG | 4 digit week year (ISO) |
a, A | AM/PM |
H, HH | 24 hour time |
h, hh | 12 hour time (use in conjunction with a or A) |
m, mm | Minutes |
s, ss | Seconds |
S | Deciseconds (1/10th of a second) |
SS | Centiseconds (1/100th of a second) |
SSS | Milliseconds (1/1000th of a second) |
Z, ZZ | Timezone offset as +07:00 or +0700 |
X | Unix timestamp |
LT, L, LL, LLL, LLLL | Locale dependent date and time representation |
Example Formatting:
"gui": { "datetime": { "name": "Time", "group": [ "Group" ], "format": "HH:mm:ss" } }
In this example, only the time is shown in the GUI (24h notation)
The weekday id counts day 1 as Sunday
ntpserver
has been removed from the datetime id. Instead, ntp-servers
are defined in the settings section of config.json in an array like this:
"ntp-servers": [ "0.nl.pool.ntp.org", "1.nl.pool.ntp.org", ... ], "ntp-sync": 1
Both the datetime and sunriseset protocol will use the ntp time to adjust their time when needed.