User Tools

Site Tools


datetime_v6_0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

datetime_v6_0 [2015/03/24 08:43]
pilino1234 Added information about new ntp server settings
datetime_v6_0 [2015/11/27 21:09]
Line 1: Line 1:
-**Date & Time** 
- 
-^Feature^Support^ 
-|Sending|{{http://​wiki.pilight.org/​lib/​images/​notsupported.gif}}| 
-|Receiving|{{http://​wiki.pilight.org/​lib/​images/​supported.gif}}| 
-|Config|{{http://​wiki.pilight.org/​lib/​images/​supported.gif}}| 
- 
-==== Supported Brands ==== 
- 
-//None// 
- 
-==== Sender Arguments ==== 
- 
-//None// 
- 
-==== Config ==== 
-<​code>​ 
-"​devices":​ { 
- "​datetime":​ { 
- "​protocol":​ [ "​datetime"​ ], 
- "​id":​ [{ 
- "​longitude":​ 1.2345, 
- "​latitude":​ 12.3456, 
- "​ntpserver":​ "​0.north-america.pool.ntp.org"​ 
- }], 
- "​year":​ 2015, 
- "​month":​ 1, 
- "​day":​ 27, 
- "​hour":​ 14, 
- "​minute":​ 37, 
- "​second":​ 8, 
- "​weekday":​ 3 
- } 
-}, 
-"​gui":​ { 
- "​datetime":​ { 
- "​name":​ "Date & Time", 
- "​group":​ [ "​Misc"​ ], 
- "​media":​ [ "​all"​ ] 
- } 
-} 
-</​code>​ 
- 
-==== Optional Settings ==== 
- 
-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| 
- 
-===== 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: 
- 
-<​code>​ 
-"​gui":​ { 
-                "​datetime":​ { 
-                        "​name":​ "​Time",​ 
-                        "​group":​ [ "​Group"​ ], 
-                        "​format":​ "​HH:​mm:​ss"​ 
-                } 
-} 
-</​code>​ 
-In this example, only the time is shown in the GUI (24h notation) 
- 
-==== Notes ==== 
- 
-The ntp-server id is optional. The ntp server will be used to check if the time is in sync with the atomic clock. 
- 
-The weekday id counts day 1 as Sunday 
- 
-==== Nightly ==== 
-ntpserver has been removed from the datetime id. Instead, ntp-server are defined in the settings section of config.json in an array like this: 
- 
-<​code>​ 
-"​ntp-servers":​ [ "​0.nl.pool.ntp.org",​ "​1.nl.pool.ntp.org",​ ... ], 
-"​ntp-sync":​ 1 
-</​code>​ 
- 
-Both the datetime and sunriseset protocol will use the ntp time to adjust 
-their time when needed. 
- 
  
datetime_v6_0.txt ยท Last modified: 2015/11/27 21:09 (external edit)