Allright, here’s my complete code how I use the time and date.
I ask the time every second, I ask the date every minute, Of course this is not the most neat way. Better would be if I update it every time 0:00 has passed. But I was lazy.
The date gets stored in a long and short global variable. The long version is translated to Dutch.
[{"id":"6d893e59.a29df8","type":"simpletime","z":"467bd729.816768","name":"Tijd","x":370,"y":180,"wires":[["f9fe7148.313ae"]]},{"id":"8754676f.f9aee","type":"inject","z":"467bd729.816768","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":180,"wires":[["6d893e59.a29df8"]]},{"id":"f9fe7148.313ae","type":"moment","z":"467bd729.816768","name":"","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Berlin","adjAmount":"1","adjType":"hours","adjDir":"add","format":"HH:mm:ss","locale":"POSIX","output":"","outputType":"msg","outTz":"Etc/UTC","x":580,"y":180,"wires":[["da083540.8844e","84913875.463f78"]]},{"id":"93e2a693.2a0238","type":"moment","z":"467bd729.816768","name":"","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Berlin","adjAmount":"1","adjType":"hours","adjDir":"add","format":"dddd DD MMMM YYYY","locale":"POSIX","output":"","outputType":"msg","outTz":"Etc/UTC","x":580,"y":280,"wires":[["5fdf98a5.826ed"]]},{"id":"da083540.8844e","type":"function","z":"467bd729.816768","name":"Store Time in global variable","func":"var Time=global.get(\"GlobalTime\") || '';\nglobal.set(\"GlobalTime\",msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":880,"y":200,"wires":[[]]},{"id":"98e20c94.7576f8","type":"function","z":"467bd729.816768","name":"Store date in global variable","func":"var Datevar=global.get(\"GlobalDate\") || '';\nglobal.set(\"GlobalDate\",msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":1000,"y":280,"wires":[[]]},{"id":"5fdf98a5.826ed","type":"function","z":"467bd729.816768","name":"Translate","func":"var mapObj = {\n Monday:\"Maandag\",\n Tuesday:\"Dinsdag\",\n Wednesday:\"Woensdag\",\n Thursday:\"Donderdag\",\n Friday:\"Vrijdag\",\n Saturday:\"Zaterdag\",\n Sunday:\"Zondag\",\n January:\"januari\",\n February:\"februari\",\n March:\"maart\",\n April:\"april\",\n May:\"mei\",\n June:\"juni\",\n July:\"juli\",\n August:\"augustus\",\n September:\"september\",\n October:\"oktober\",\n November:\"november\",\n December:\"december\"\n};\nmsg.payload = msg.payload.replace(/Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|January|February|March|April|May|June|July|August|September|October|November|December/gi, function(matched){\n return mapObj[matched];\n});\n\n\nreturn msg;","outputs":1,"noerr":0,"x":780,"y":280,"wires":[["98e20c94.7576f8"]]},{"id":"ba5e2310.957f78","type":"simpletime","z":"467bd729.816768","name":"Tijd","x":370,"y":280,"wires":[["93e2a693.2a0238","a79d6817.53c"]]},{"id":"8fa1d970.d4e3c8","type":"inject","z":"467bd729.816768","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":280,"wires":[["ba5e2310.957f78"]]},{"id":"aee33ba6.94d688","type":"function","z":"467bd729.816768","name":"Store date in global variable","func":"var Datevar=global.get(\"GlobalDateShort\") || '';\nglobal.set(\"GlobalDateShort\",msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":1000,"y":320,"wires":[[]]},{"id":"a79d6817.53c","type":"moment","z":"467bd729.816768","name":"","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Berlin","adjAmount":"1","adjType":"hours","adjDir":"add","format":"DD-MM","locale":"POSIX","output":"","outputType":"msg","outTz":"Etc/UTC","x":580,"y":320,"wires":[["aee33ba6.94d688"]]},{"id":"7d507038.43d818","type":"ui_template","z":"467bd729.816768","group":"c4a9cc50.74ad","name":"Tijd / Datum","order":1,"width":"6","height":"2","format":"<p style=\"font-size:45px; text-align: center; font-weight: bold;\">{{msg.time}}</p> \n<p style=\"font-size:15px; text-align: center; font-weight: bold;\"><i style=\"color:#0094CE!important;\" class=\"fa fa-calendar\" aria-hidden=\"true\"></i> {{msg.date}}</p>\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1210,"y":160,"wires":[[]]},{"id":"84913875.463f78","type":"function","z":"467bd729.816768","name":"Set icon color and temperature","func":"var Datevar=global.get(\"GlobalDate\") || '';\nmsg = {time:msg.payload, date:Datevar};\nreturn msg;","outputs":1,"noerr":0,"x":890,"y":160,"wires":[["7d507038.43d818"]]},{"id":"c4a9cc50.74ad","type":"ui_group","z":"","name":"Vandaag","tab":"f735aa47.f5cd18","order":2,"disp":true,"width":"6","collapse":false},{"id":"f735aa47.f5cd18","type":"ui_tab","z":"","name":"Homey Dashboard","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
Use the global variable long or short date just like the time.
[EDIT] “Set icon color and temperature” -name does not make sense… I copied it from another node and forgot to rename it