Blazor webassembly has a bug, it always use UTC time as your local timezone. So no matter what the timezone you are in,
.ToLocalTime() will always returning UTC time to you.
public class Program
new Date().getTimezoneOffset() returns
UTC - localtime in minutes, so we use
- before it to get the delta of
localtime - UTC which can be directly used in