Home:ALL Converter>Scheduling dates in with daylight saving time

Scheduling dates in with daylight saving time

Ask Time:2020-03-27T08:57:16         Author:CaptainMorgan

Json Formatter

I have an Angular App with a C# webapi. I'm trying to schedule jobs at 12pm, once per week for 5 weeks.

The dates are saved in the database in UTC time (and I'm in Melbourne time +11UTC). So as of now, all times would be stored at 1am. The problem is, we go out of daylight saving time soon (+10UTC), so the times stored will be incorrect and displayed to the user as 11am

I think what I have to do is add one hour to the times that are not in daylight saving time. But in C#, how can I determine what the current UTC offset is and what the UTC offset of a date is in the future?

Author:CaptainMorgan,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60878441/scheduling-dates-in-with-daylight-saving-time
yy