[TimezoneReactiveUtils] Add support to daylight savings
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.

Example: 

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.

mvp_badge
MVP

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

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