Class DateTimeConverter
Centralized DateTime conversion logic.
RULE: DateTime is ALWAYS treated as UTC in REDB system.
CONTRACT:
On save: any DateTime → UTC (via NormalizeForStorage)
On read: DateTimeOffset from DB → DateTime with Kind=Utc (via DenormalizeFromStorage)
On search: any DateTime → UTC (via NormalizeForStorage)
On JSON: DateTimeOffset → DateTime with Kind=Utc (via DenormalizeFromStorage)
IMPORTANT: DateTimeOffset remains as is (preserves timezone information)
public static class DateTimeConverter
Inheritance
Methods
DenormalizeFromStorage(DateTimeOffset)
Denormalize DateTime from DB for returning to user.
public static DateTime DenormalizeFromStorage(DateTimeOffset dateTimeOffset)
NormalizeForStorage(DateTime)
Normalize DateTime for saving to DB.
public static DateTime NormalizeForStorage(DateTime dateTime)
ParseAsUtc(string)
Parse DateTime from string (JSON/SQL) as UTC.
public static DateTime ParseAsUtc(string value)