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