[TimezoneReactiveUtils] Add support to daylight savings
Reactive icon
Forge component by Magda Pereira

Hello team.

I would like to suggest a change to the component to add support to scenarios with daylight savings.


Today, 07-April-2021, in Portugal, we are Summer Time (UTC+1), if I use the ConvertDateTimeToUTC to check the DateTime 07-April-2021 07:00:00, it will return 07-April-2021 06:00:00. 

However, if I had done it on 01-January-2021 (UTC), in Portugal, it would return 07-April-2021 07:00:00, making it inconsistent(not idempotent). The reason is that GetCurrentTimezoneOffset uses the current DateTime to calculate the timezone offset and it is being used inside ConvertDateTimeToUTC action.

My suggestion would be to create a new action that retrieves the offset based on the input DateTime and using it on the ConvertDateTimeToUTC action.

Gabriel Cardoso 

Agreed, I just came to the same conclusion. Relying on now.getTimezoneOffset() is not correct in all cases. It does return the current timezone offset, but when converting a date, you should take the offset at that specific date, not the current one.

I disagree with a new action. It's just a bug in the current one, that needs to be fixed.

Im also facing the same issue now. Is there any other alternative solution?

Well, the short-term solution would be to clone the component and bugfix it, as per what's described above. But I've also pinged some maintainers, perhaps they can finally fix this bug.

Thank you. I will try to fix that issue 

hi all. Did this get resolved?

We are having issues in the UK with UTC and need for seasonal adjustment? The solution currently being attempted seems laborious imho (that is, using another forge component). I just happened to spot TimezoneReactiveUtils (and this page!) and it struck me as a more elegant solution.

Many thanks

Hi Peter,

I'll take a look. I thought this was fixed, but apparently not quite. I'll keep you posted.

Hi Peter,

I could reproduce the bug, and fixed the problem. I uploaded a new version (1.0.5) that you could try. Please let me know if it fixes your problem.

Hi Kilian
Cannot promise that I'll do this soon as have moved onto other issues. Will do so at some point, though, and get back to you.

Thanks for looking at this.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.