My location in GMT +5: 30
When I try to find getTimezoneOffset using JavaScript
var x = new Date(); var currentTimeZoneOffsetInHours = x.getTimezoneOffset() / 60;
I get a value of -5.5 . Curious when I do the same with C #
var localZone = TimeZone.CurrentTimeZone; var localOffset = localZone.GetUtcOffset(new Date()); var currentTimeZoneOffsetInHours = localOffset.TotalHours;
The return value is 5.5 .
Is this sign redesigned or do I not see anything important?
source share