How to convert a UTC DateTimeOffset to a DateTime that uses the systems timezone
You can just use the DateTimeOffset.LocalDateTime
property:
trigger.GetNextFireTimeUtc().Value.LocalDateTime
From the documentation:
If necessary, the LocalDateTime property converts the current DateTimeOffset object's date and time to the local system's date and time. The conversion is a two-step operation:
- The property converts the current DateTimeOffset object's time to Coordinated Universal Time (UTC).
- The property then converts UTC to local time.
You should really look into DateTimeOffset
though - it's an important type to understand if you're using the BCL for date/time work.