-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange Date/Timezone Bug is misleading in IF-Node #1380
Comments
Hey @ixidion |
@naskio Yes, I think there was also a Postgres-Node somewhere, but it's not necessary to reproduce. |
Hey @ixidion, I am just running through some of the older issues and have attempted to reproduce this one but I have not had any luck. I have set my default timezone in the container and the TZ variable to Europe/Berlin instead of my normal Europe/London setting and the expressions seems to evaluate correctly. Are you still seeing this issue on the latest release? |
Hey @Joffcom |
Hey @naskio, That is interesting, I can't see what the link could be though 🤔 For the UI to display the date from the expression I wouldn't have thought the database would be touched. I will test in the morning using a Postgres DB and see if that changes anything, I take it you have been able to reproduce this issue? |
Hey @Joffcom
// I am on GMT+2
let dateTZ = new Date(2021, 0, 22, 0, 0, 0, 0);
console.log("dateTZ", dateTZ.getTime()); // dateTZ 1611270000000
let dateUTC = Date.UTC(2021, 0, 22, 0, 0, 0, 0);
console.log("dateUTC", dateUTC); // dateUTC 1611273600000 |
|
@Joffcom
|
Hey @naskio, Can you send me the environment variables you have set? In thoery I should be seeing an incorrect value as my machine is set to GMT but n8n is set to +2 but I see the +2 result in the browser so I am wondering if maybe this is more of a config issue or there is another option that I am missing. |
My n8n environment:
(Sorry, I forgot that I switched to GMT because I faced many issues while using my local timezone) My machine is set to GMT+2 |
My local time is set to CEST (is: UTC+2). |
This is very odd, maybe I need to change my desktop timezone to see the problem 🤔 @RicardoE105 you are on a different timezone to me, are you able to reproduce this? |
Hello @ixidion , I do not think this is a bug, here for example from browser's console when timezone isn't specified: |
@michael-radency Thank you for elaborating. So, it seems like it is a JavaScript/Browser Pitfall. I'm with you, doesn't look like a IF-Node bug. |
Hello @ixidion , thanks for replying, as we agree that this behavior is not a n8n bug and it's not related to IF node I'll close this issue |
Describe the bug
Creating a Date() in an expression applies Timezone-Settings for the UI.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The Box should show "1611273600000" as expected with no Timezone-Settings applied. But maybe it's more complicated cause of the timezones.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: