I need to know what a temporary offset is for a device that launches my application in minutes. For example, for Pacific standard time (where I'm testing) I need to get int -480. Examples (which I could not get from my current location, but to give you an idea of ββwhat I need) in Afghanistan, I would get 270, and in the UK I would get 0.
My best attempts so far have all returned 0, which is the wrong value:
int timezoneOffsetInMinutes = (DateTime.Now.ToLocalTime() - DateTime.Now).Minutes
and
int timezoneOffsetInMinutes = TimeZoneInfo.Utc.BaseUtcOffset.Minutes - TimeZoneInfo.Local.BaseUtcOffset.Minutes;
I was not sure that this post asked the same question (since no examples of offsets or sample code are given), but the one answer that is given there is definitely not related to what I'm looking for.
source share