Giter VIP home page Giter VIP logo

Comments (9)

zachowj avatar zachowj commented on June 2, 2024

Run this flow and what does it display in the debug tab?

[{"id":"8f353b43.9369c8","type":"inject","z":"5eb3594f.d294b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":92,"y":672,"wires":[["42e6362a.003848"]]},{"id":"d972a939.f4a9c8","type":"debug","z":"5eb3594f.d294b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":386,"y":672,"wires":[]},{"id":"42e6362a.003848","type":"function","z":"5eb3594f.d294b8","name":"","func":"msg.payload = new Date();\n\nreturn msg;","outputs":1,"noerr":0,"x":238,"y":672,"wires":[["d972a939.f4a9c8"]]}]

from node-red-contrib-home-assistant-websocket.

Hisma avatar Hisma commented on June 2, 2024

Mon Jan 28 2019 16:44:13 GMT-0500 (EST)
Imgur

That is the correct time by the way.

from node-red-contrib-home-assistant-websocket.

zachowj avatar zachowj commented on June 2, 2024

If you just attach a inject node to a current state node does it give you the incorrect time below the node?

from node-red-contrib-home-assistant-websocket.

Hisma avatar Hisma commented on June 2, 2024

same result, incorrect time below the node.
Imgur
Time below the node SHOULD be 18:51, not 23:51. It's displaying to UTC +0.
Something else of note, even though the timestamp is wrong on the service node, other nodes display the correct time, and I have an automation that toggles lights depending on dawn/dusk, and it operated at the appropriate time. But it still displayed the wrong timestamp underneath the service node.
edit: updated with current state node also showing incorrect time -
Imgur

from node-red-contrib-home-assistant-websocket.

zachowj avatar zachowj commented on June 2, 2024

This is the exact code that displays the status date. Give it a try and see if it still displays the incorrect offset.

[{"id":"8f353b43.9369c8","type":"inject","z":"5eb3594f.d294b8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":92,"y":672,"wires":[["42e6362a.003848"]]},{"id":"d972a939.f4a9c8","type":"debug","z":"5eb3594f.d294b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":386,"y":672,"wires":[]},{"id":"42e6362a.003848","type":"function","z":"5eb3594f.d294b8","name":"","func":"msg.payload = new Date().toLocaleDateString('en-US', {\n            month: 'short',\n            day: 'numeric',\n            hour12: false,\n            hour: 'numeric',\n            minute: 'numeric'\n        });\n\nreturn msg;","outputs":1,"noerr":0,"x":238,"y":672,"wires":[["d972a939.f4a9c8"]]}]

from node-red-contrib-home-assistant-websocket.

Hisma avatar Hisma commented on June 2, 2024

When I inject that node here is the debug output -

1/29/2019, 6:12:28 PM node: 8b20087a.a07d48
msg.payload : string[13]
"Jan 29, 23:12"

The time is still incorrect.
Note that the debug message timestamp is 5 hours earlier, which again, is the correct time.

from node-red-contrib-home-assistant-websocket.

zachowj avatar zachowj commented on June 2, 2024

Try adding the timezone via the environment variable in your docker-compose file.

  node-red:
    environment:
      - TZ=America/New_York

from node-red-contrib-home-assistant-websocket.

Hisma avatar Hisma commented on June 2, 2024

Surprisingly, that fixed it. Thank you!
1/29/2019, 8:12:04 PMnode: 8b20087a.a07d48 msg.payload : string[13] "Jan 29, 20:12"
I hope this is something that could be fixed though. I could not find this information documented anywhere. Defining the localtime file as a volume should be enough imo.
Appreciate you working with me to fix this

from node-red-contrib-home-assistant-websocket.

zachowj avatar zachowj commented on June 2, 2024

Here's where I found it or could be something very similar to it.

docker-library/openjdk#80

from node-red-contrib-home-assistant-websocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.