Safely convert UTC datetimes to local time (based on TZ) for calculations?

Posted by James on Stack Overflow See other posts from Stack Overflow or by James
Published on 2010-04-15T17:15:06Z Indexed on 2010/04/15 18:13 UTC
Read the original article Hit count: 269

Filed under:
|
|
|
|

Following from my last question which @Jon Skeet gave me a lot of help with (thanks again!)

I am now wondering how I can safely work with date/times, stored as UTC, when they are converted back to Local Date/Time.

As Jon indicated in my last question using DateTimeOffset represents an instant in time and there is no way to predict what the local time would be say a minute later. I need to be able to do calculations based on these date/times.

So how can I assure when I pull the dates from the database, convert them to local date/time and do specific calculations on them they are going to be accurate?

© Stack Overflow or respective owner

Related posts about c#

Related posts about utc