Пример #1
0
    // Token: 0x060005DB RID: 1499 RVA: 0x00028E4C File Offset: 0x0002704C
    internal static bool smethod_12(Struct8 struct8_0, DateTimeZoneHandling dateTimeZoneHandling_0, out DateTime dateTime_0)
    {
        Struct5 @struct = default(Struct5);

        if ([email protected]_0(struct8_0.method_0(), struct8_0.method_1(), struct8_0.method_2()))
        {
            dateTime_0 = default(DateTime);
            return(false);
        }
        DateTime dateTime_ = Class25.smethod_14(@struct);

        switch (@struct.enum6_0)
        {
        case (Enum6)1:
            dateTime_ = new DateTime(dateTime_.Ticks, DateTimeKind.Utc);
            break;

        case (Enum6)2:
        {
            TimeSpan timeSpan = new TimeSpan(@struct.int_7, @struct.int_8, 0);
            long     num      = dateTime_.Ticks + timeSpan.Ticks;
            if (num <= DateTime.MaxValue.Ticks)
            {
                dateTime_ = new DateTime(num, DateTimeKind.Utc).ToLocalTime();
            }
            else
            {
                num += dateTime_.smethod_0().Ticks;
                if (num > DateTime.MaxValue.Ticks)
                {
                    num = DateTime.MaxValue.Ticks;
                }
                dateTime_ = new DateTime(num, DateTimeKind.Local);
            }
            break;
        }

        case (Enum6)3:
        {
            TimeSpan timeSpan2 = new TimeSpan(@struct.int_7, @struct.int_8, 0);
            long     num       = dateTime_.Ticks - timeSpan2.Ticks;
            if (num >= DateTime.MinValue.Ticks)
            {
                dateTime_ = new DateTime(num, DateTimeKind.Utc).ToLocalTime();
            }
            else
            {
                num += dateTime_.smethod_0().Ticks;
                if (num < DateTime.MinValue.Ticks)
                {
                    num = DateTime.MinValue.Ticks;
                }
                dateTime_ = new DateTime(num, DateTimeKind.Local);
            }
            break;
        }
        }
        dateTime_0 = Class25.smethod_2(dateTime_, dateTimeZoneHandling_0);
        return(true);
    }
Пример #2
0
    // Token: 0x060005DC RID: 1500 RVA: 0x00028FE0 File Offset: 0x000271E0
    internal static bool smethod_13(Struct8 struct8_0, out DateTimeOffset dateTimeOffset_0)
    {
        Struct5 @struct = default(Struct5);

        if ([email protected]_0(struct8_0.method_0(), struct8_0.method_1(), struct8_0.method_2()))
        {
            dateTimeOffset_0 = default(DateTimeOffset);
            return(false);
        }
        DateTime dateTime = Class25.smethod_14(@struct);
        TimeSpan utcOffset;

        switch (@struct.enum6_0)
        {
        case (Enum6)1:
            utcOffset = new TimeSpan(0L);
            break;

        case (Enum6)2:
            utcOffset = new TimeSpan([email protected]_7, [email protected]_8, 0);
            break;

        case (Enum6)3:
            utcOffset = new TimeSpan(@struct.int_7, @struct.int_8, 0);
            break;

        default:
            utcOffset = TimeZoneInfo.Local.GetUtcOffset(dateTime);
            break;
        }
        long num = dateTime.Ticks - utcOffset.Ticks;

        if (num >= 0L && num <= 3155378975999999999L)
        {
            dateTimeOffset_0 = new DateTimeOffset(dateTime, utcOffset);
            return(true);
        }
        dateTimeOffset_0 = default(DateTimeOffset);
        return(false);
    }