Hello:
I would like it so that the time displayed was always for CDT/CDS.
Potentially, the application can be run at locations in Mountain Time
or Central Time. This is what I have now:
// get the UTC offset depending on day light savings
double hourOffset = DateTime.Now.Is DaylightSavingT ime() ? -5 : -6;
DateTimeOffset offset =
DateTimeOffset. UtcNow.ToOffset (TimeSpan.FromH ours(hourOffset ));
Essentially, is there a way to get the time in a particular timezone
regardless of where the application is run?
Thanks,
Travis
I would like it so that the time displayed was always for CDT/CDS.
Potentially, the application can be run at locations in Mountain Time
or Central Time. This is what I have now:
// get the UTC offset depending on day light savings
double hourOffset = DateTime.Now.Is DaylightSavingT ime() ? -5 : -6;
DateTimeOffset offset =
DateTimeOffset. UtcNow.ToOffset (TimeSpan.FromH ours(hourOffset ));
Essentially, is there a way to get the time in a particular timezone
regardless of where the application is run?
Thanks,
Travis
Comment