User Tools

Site Tools


datetime_v7_0

Date & Time

FeatureSupport
Sending
Receiving
Config

Supported Brands

None

Sender Arguments

None

Config

"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" ]
	}
}

Optional Settings

GUI settings

SettingDefaultFormatDescription
show-datetime11 or 0Don't display the datetime values
formatHH:mm:ss YYYY-MM-DDsee belowDatetime formatting

Formatting

InputOutput
M, MMMonth Number (1 - 12)
MMM, MMMMMonth Name (In currently language set by moment.lang())
D, DDDay of month
DDD, DDDDDay of year
d, dd, ddd, ddddDay of week (NOTE: these formats only make sense when combined with “ww”)
eDay of week (locale) (NOTE: these formats only make sense when combined with “ww”)
EDay of week (ISO) (NOTE: this format only make sense when combined with “WW”)
w, wwWeek of the year (NOTE: combine this format with “gg” or “gggg” instead of “YY” or “YYYY”)
W, WWWeek of the year (NOTE: combine this format with “GG” or “GGGG” instead of “YY” or “YYYY”)
YY2 digit year (if greater than 68 will return 1900's, otherwise 2000's)
YYYY4 digit year
gg2 digit week year (if greater than 68 will return 1900's, otherwise 2000's)
gggg4 digit week year
GG2 digit week year (ISO) (if greater than 68 will return 1900's, otherwise 2000's)
GGGG4 digit week year (ISO)
a, AAM/PM
H, HH24 hour time
h, hh12 hour time (use in conjunction with a or A)
m, mmMinutes
s, ssSeconds
SDeciseconds (1/10th of a second)
SSCentiseconds (1/100th of a second)
SSSMilliseconds (1/1000th of a second)
Z, ZZTimezone offset as +07:00 or +0700
XUnix timestamp
LT, L, LL, LLL, LLLLLocale 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)

Notes

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.

datetime_v7_0.txt · Last modified: 2016/04/13 02:40 by alasdairc