Problem with the date format

Hi, wow, not certain what you are actually trying to achieve but there was a fair amount of extra nodes and extra processing and function nodes that were not necessary.

Before...


image

After...

[{"id":"2a6e9727.ba3b18","type":"inject","z":"19e1b6f3.b0b619","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay":0.1,"x":990,"y":100,"wires":[["51dbcbb7.3e8524"]]},{"id":"dfc7657c.b0c688","type":"comment","z":"19e1b6f3.b0b619","name":"Obtenemos el Día y la Hora","info":"","x":1020,"y":60,"wires":[]},{"id":"8dc6ee6b.69de4","type":"ui_template","z":"19e1b6f3.b0b619","group":"744a90ef.637b9","name":"Tijd / Datum","order":1,"width":10,"height":3,"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>&nbsp;&nbsp;{{msg.date}}</p>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":1190,"y":220,"wires":[[]]},{"id":"bafd4649.a56698","type":"change","z":"19e1b6f3.b0b619","name":"update global vars","rules":[{"t":"set","p":"GlobalDateShort","pt":"global","to":"dateShort","tot":"msg"},{"t":"set","p":"GlobalDate","pt":"global","to":"date","tot":"msg"},{"t":"set","p":"GlobalTime","pt":"global","to":"time","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":220,"wires":[["8dc6ee6b.69de4","c765af18.10afa"]]},{"id":"c765af18.10afa","type":"debug","z":"19e1b6f3.b0b619","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1170,"y":260,"wires":[]},{"id":"51dbcbb7.3e8524","type":"moment","z":"19e1b6f3.b0b619","name":"HH:mm:ss --> msg.time","topic":"","input":"payload","inputType":"msg","inTz":"Europe/London","adjAmount":"2","adjType":"hours","adjDir":"add","format":"HH:mm:ss","locale":"es_ES","output":"time","outputType":"msg","outTz":"Etc/UTC","x":1230,"y":100,"wires":[["7f904698.bdfdb8"]]},{"id":"7f904698.bdfdb8","type":"moment","z":"19e1b6f3.b0b619","name":"date --> msg.date","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Berlin","adjAmount":"2","adjType":"hours","adjDir":"add","format":"dddd DD MMMM YYYY","locale":"es_ES","output":"date","outputType":"msg","outTz":"Etc/UTC","x":990,"y":160,"wires":[["e5bdb315.80dd"]]},{"id":"e5bdb315.80dd","type":"moment","z":"19e1b6f3.b0b619","name":"DD-MM --> msg.dateShort","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Berlin","adjAmount":"2","adjType":"hours","adjDir":"add","format":"DD-MM","locale":"es_ES","output":"dateShort","outputType":"msg","outTz":"Etc/UTC","x":1240,"y":160,"wires":[["bafd4649.a56698"]]},{"id":"744a90ef.637b9","type":"ui_group","z":"","name":"Default","tab":"a17cee11.28837","order":1,"disp":true,"width":"10","collapse":false},{"id":"a17cee11.28837","type":"ui_tab","z":"","name":"Home Orig","icon":"dashboard","disabled":false,"hidden":false}]

Issues...

  1. SimpleTime node is unnecessary (the inject generates a time stamp)
  2. You had 2 separate flows but 1 of them didnt actually update globals
  3. I suspect you dont need the globals at all (i guess you were using them to display all values at once?) By putting the nodes in series, all values the values you need are collected in one msg - all in one go
  4. Your Translate node was unnecessary as the moment node returns spanish text.
  5. Function nodes are heavy & overkill for storing values in global context.
1 Like