Home Assistant Node time different in actual. Timezone set

Describe the problem/error/question

I’m using self-hosted n8n on my unraid server.

My problem is that when I use Home Assistant with the Get operation (or other nodes), the time is not the same. I have set up the n8n timezone using the env variable GENERIC_TIMEZONE.

This is the time on my Home Assistant for this particular sensor:

And this is what it gets by the node in n8n.

My Timezone settings in my unraid template:

n8n workflow timezone:

What is the error message (if any)?

No error message but the time output of the node is different.

Please share your workflow

It’s just 1 single node.

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

The output is on the image above.

Information on your n8n setup

  • n8n version: 1.115.3
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): I don’t know the answer to this.
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Unraid OS

Hi @HHUBSS

It seems that the timestamp is in UTC.

As a quick fix, you can convert it to your preferred timezone, use a Set node after this Home Assistant node, and add an expression like this:

{{ $json.last_changed.toDateTime().setZone('Asia/Manila') }}
1 Like

Thanks @mohamed3nan

Do you have any idea why it is outputting in UTC?

I think this is what their API returns:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.