System.TimeZoneInfo.GetLocalUtcOffset C# (CSharp) Method

GetLocalUtcOffset() static private method

static private GetLocalUtcOffset ( System.DateTime dateTime, TimeZoneInfoOptions flags ) : System.TimeSpan
dateTime System.DateTime
flags TimeZoneInfoOptions
return System.TimeSpan
		internal static TimeSpan GetLocalUtcOffset(DateTime dateTime, TimeZoneInfoOptions flags)
		{
			bool dst;
			return Local.GetUtcOffset (dateTime, out dst);
		}

Usage Example

 // Token: 0x060015E8 RID: 5608 RVA: 0x00040EC8 File Offset: 0x0003F0C8
 private static void FormatCustomizedRoundripTimeZone(DateTime dateTime, TimeSpan offset, StringBuilder result)
 {
     if (offset == DateTimeFormat.NullOffset)
     {
         DateTimeKind kind = dateTime.Kind;
         if (kind == DateTimeKind.Utc)
         {
             result.Append("Z");
             return;
         }
         if (kind != DateTimeKind.Local)
         {
             return;
         }
         offset = TimeZoneInfo.GetLocalUtcOffset(dateTime, TimeZoneInfoOptions.NoThrowOnInvalidTime);
     }
     if (offset >= TimeSpan.Zero)
     {
         result.Append('+');
     }
     else
     {
         result.Append('-');
         offset = offset.Negate();
     }
     result.AppendFormat(CultureInfo.InvariantCulture, "{0:00}:{1:00}", offset.Hours, offset.Minutes);
 }
All Usage Examples Of System.TimeZoneInfo::GetLocalUtcOffset