How can I get the difference between local time and UTC time in minutes (in C#)?
Use TimeZoneInfo
:
TimeSpan delta = TimeZoneInfo.Local.GetUtcOffset();
double utcMinuteOffset = delta.TotalMinutes;
This should give you what you need.
(DateTime.UtcNow - DateTime.Now).TotalMinutes;
Also you may find the .ToUniversalTime
DateTime function of use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With