Initial note: i think the answer to your question is opinion and experience based only.
Quote:
- What is the preferred way of handling this kind of situation?
Well, there are possible two ways to store dates in a database:
1) UTC time
or
2) DateTime + Offset
The second method is recommended by me due to the most important reason:
Quote:
The DateTimeOffset structure represents a date and time value, together with an offset that indicates how much that value differs from UTC. Thus, the value always unambiguously identifies a single point in time.
Below example explains it better than thousands of words:
DateTimeOffset date1 = DateTimeOffset.Now;
DateTimeOffset date2 = DateTimeOffset.UtcNow;
int diff = ((TimeSpan)(date1 - date2)).Hours;
Console.WriteLine("client time: {0} | utc time: {1} | hour difference: {2}", date1, date2, diff);
In case you want to use UTC time and adjustmant rules, i have to warn you:
Quote:
The precise time zone information that is required by an application may not be present on a particular system for several reasons:
- The time zone has never been defined in the local system's registry.
- Data about the time zone has been modified or removed from the registry.
- The time zone does not have accurate information about time zone adjustments for a particular historic period.
For further details, please see:
How to: Create time zones with adjustment rules | Microsoft Docs[
^]
Choosing between DateTime, DateTimeOffset, TimeSpan, and TimeZoneInfo | Microsoft Docs[
^]
Quote:
- Is there a nice solution with saving UTC datetimes because that one would be pretty nice for us because of the system-level reporting?
- If going with saving UTC, is Method 2) good way to handle those cases or is there some better/recommended way?
- How to Query calls between Aug 20 2019 to Aug 30 2019 dates? ( Here Date always tenant timezone dates )
- How to Query hourly based calls count Aug 20 2019 ? ( Here Date always tenant timezone dates )
- How to create a daily report, based on the day of the user's time zone?
If you would like to choose UTC, please, read Richard's comment to the question. He have already answered these questions.