src/fursvp.helpers/DateTimeExtensions.cs
/// <summary>
/// Converts a DateTime from utc time to a local time zone.
/// </summary>
/// <param name="utcDateTime">The utc datetime.</param>
/// <param name="targetTimeZoneId">The local time zone to which to convert from utc time.</param>
/// <returns>The local datetime.</returns>
Converts a DateTime from utc time to a local time zone.
Converts a DateTime from utc time to a local time zone .
public static DateTime ToLocal(this DateTime utcDateTime, string targetTimeZoneId)
        {
            var timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(targetTimeZoneId);
            return ToLocal(utcDateTime, timeZoneInfo);
        }
public static DateTime ToLocal ( this DateTime utcDateTime , string targetTimeZoneId ) { var timeZoneInfo = TimeZoneInfo . FindSystemTimeZoneById ( targetTimeZoneId ) ; return ToLocal ( utcDateTime , timeZoneInfo ) ; }
Converts a DateTime from utc time to a local time zone.
Converts a DateTime from utc time to a local time zone .
The local datetime.
The local datetime .
DateTime
this
targetTimeZoneId
string
The local time zone to which to convert from utc time.
The local time zone to which to convert from utc time .
utcDateTime
The utc datetime.
The utc datetime .