Files
Dec2017-Script-Dump/mscorlib/System/DateTime.cs
T
2026-06-04 11:42:34 +02:00

3019 lines
138 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System
{
/// <summary>Represents an instant in time, typically expressed as a date and time of day. </summary>
/// <filterpriority>1</filterpriority>
// Token: 0x02000653 RID: 1619
[Serializable]
[StructLayout(LayoutKind.Auto)]
public struct DateTime : IFormattable, IConvertible, IComparable, IComparable<DateTime>, IEquatable<DateTime>
{
/// <summary>Initializes a new instance of the <see cref="T:System.DateTime" /> structure to a specified number of ticks.</summary>
/// <param name="ticks">A date and time expressed in the number of 100-nanosecond intervals that have elapsed since January 1, 0001 at 00:00:00.000 in the Gregorian calendar. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="ticks" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
// Token: 0x06003D24 RID: 15652 RVA: 0x000CDB84 File Offset: 0x000CBD84
public DateTime(long ticks)
{
this.ticks = new TimeSpan(ticks);
if (ticks < DateTime.MinValue.Ticks || ticks > DateTime.MaxValue.Ticks)
{
string text = Locale.GetText("Value {0} is outside the valid range [{1},{2}].", new object[]
{
ticks,
DateTime.MinValue.Ticks,
DateTime.MaxValue.Ticks
});
throw new ArgumentOutOfRangeException("ticks", text);
}
this.kind = DateTimeKind.Unspecified;
}
/// <summary>Initializes a new instance of the <see cref="T:System.DateTime" /> structure to the specified year, month, and day.</summary>
/// <param name="year">The year (1 through 9999). </param>
/// <param name="month">The month (1 through 12). </param>
/// <param name="day">The day (1 through the number of days in <paramref name="month" />). </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="year" /> is less than 1 or greater than 9999.-or- <paramref name="month" /> is less than 1 or greater than 12.-or- <paramref name="day" /> is less than 1 or greater than the number of days in <paramref name="month" />. </exception>
/// <exception cref="T:System.ArgumentException">The specified parameters evaluate to less than <see cref="F:System.DateTime.MinValue" /> or more than <see cref="F:System.DateTime.MaxValue" />. </exception>
// Token: 0x06003D25 RID: 15653 RVA: 0x000CDC1C File Offset: 0x000CBE1C
public DateTime(int year, int month, int day)
{
this = new DateTime(year, month, day, 0, 0, 0, 0);
}
/// <summary>Initializes a new instance of the <see cref="T:System.DateTime" /> structure to the specified year, month, day, hour, minute, and second.</summary>
/// <param name="year">The year (1 through 9999). </param>
/// <param name="month">The month (1 through 12). </param>
/// <param name="day">The day (1 through the number of days in <paramref name="month" />). </param>
/// <param name="hour">The hours (0 through 23). </param>
/// <param name="minute">The minutes (0 through 59). </param>
/// <param name="second">The seconds (0 through 59). </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="year" /> is less than 1 or greater than 9999. -or- <paramref name="month" /> is less than 1 or greater than 12. -or- <paramref name="day" /> is less than 1 or greater than the number of days in <paramref name="month" />.-or- <paramref name="hour" /> is less than 0 or greater than 23. -or- <paramref name="minute" /> is less than 0 or greater than 59. -or- <paramref name="second" /> is less than 0 or greater than 59. </exception>
/// <exception cref="T:System.ArgumentException">The specified parameters evaluate to less than <see cref="F:System.DateTime.MinValue" /> or more than <see cref="F:System.DateTime.MaxValue" />. </exception>
// Token: 0x06003D26 RID: 15654 RVA: 0x000CDC38 File Offset: 0x000CBE38
public DateTime(int year, int month, int day, int hour, int minute, int second)
{
this = new DateTime(year, month, day, hour, minute, second, 0);
}
/// <summary>Initializes a new instance of the <see cref="T:System.DateTime" /> structure to the specified year, month, day, hour, minute, second, and millisecond.</summary>
/// <param name="year">The year (1 through 9999). </param>
/// <param name="month">The month (1 through 12). </param>
/// <param name="day">The day (1 through the number of days in <paramref name="month" />). </param>
/// <param name="hour">The hours (0 through 23). </param>
/// <param name="minute">The minutes (0 through 59). </param>
/// <param name="second">The seconds (0 through 59). </param>
/// <param name="millisecond">The milliseconds (0 through 999). </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="year" /> is less than 1 or greater than 9999.-or- <paramref name="month" /> is less than 1 or greater than 12.-or- <paramref name="day" /> is less than 1 or greater than the number of days in <paramref name="month" />.-or- <paramref name="hour" /> is less than 0 or greater than 23.-or- <paramref name="minute" /> is less than 0 or greater than 59.-or- <paramref name="second" /> is less than 0 or greater than 59.-or- <paramref name="millisecond" /> is less than 0 or greater than 999. </exception>
/// <exception cref="T:System.ArgumentException">The specified parameters evaluate to less than <see cref="F:System.DateTime.MinValue" /> or more than <see cref="F:System.DateTime.MaxValue" />. </exception>
// Token: 0x06003D27 RID: 15655 RVA: 0x000CDC58 File Offset: 0x000CBE58
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond)
{
if (year < 1 || year > 9999 || month < 1 || month > 12 || day < 1 || day > DateTime.DaysInMonth(year, month) || hour < 0 || hour > 23 || minute < 0 || minute > 59 || second < 0 || second > 59 || millisecond < 0 || millisecond > 999)
{
throw new ArgumentOutOfRangeException("Parameters describe an unrepresentable DateTime.");
}
this.ticks = new TimeSpan(DateTime.AbsoluteDays(year, month, day), hour, minute, second, millisecond);
this.kind = DateTimeKind.Unspecified;
}
/// <summary>Initializes a new instance of the <see cref="T:System.DateTime" /> structure to the specified year, month, and day for the specified calendar.</summary>
/// <param name="year">The year (1 through the number of years in <paramref name="calendar" />). </param>
/// <param name="month">The month (1 through the number of months in <paramref name="calendar" />). </param>
/// <param name="day">The day (1 through the number of days in <paramref name="month" />). </param>
/// <param name="calendar">The calendar that is used to interpret <paramref name="year" />, <paramref name="month" />, and <paramref name="day" />. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="calendar" /> is null.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="year" /> is not in the range supported by <paramref name="calendar" />.-or- <paramref name="month" /> is less than 1 or greater than the number of months in <paramref name="calendar" />.-or- <paramref name="day" /> is less than 1 or greater than the number of days in <paramref name="month" />. </exception>
/// <exception cref="T:System.ArgumentException">The specified parameters evaluate to less than <see cref="F:System.DateTime.MinValue" /> or more than <see cref="F:System.DateTime.MaxValue" />. </exception>
// Token: 0x06003D28 RID: 15656 RVA: 0x000CDD10 File Offset: 0x000CBF10
public DateTime(int year, int month, int day, Calendar calendar)
{
this = new DateTime(year, month, day, 0, 0, 0, 0, calendar);
}
/// <summary>Initializes a new instance of the <see cref="T:System.DateTime" /> structure to the specified year, month, day, hour, minute, and second for the specified calendar.</summary>
/// <param name="year">The year (1 through the number of years in <paramref name="calendar" />). </param>
/// <param name="month">The month (1 through the number of months in <paramref name="calendar" />). </param>
/// <param name="day">The day (1 through the number of days in <paramref name="month" />). </param>
/// <param name="hour">The hours (0 through 23). </param>
/// <param name="minute">The minutes (0 through 59). </param>
/// <param name="second">The seconds (0 through 59). </param>
/// <param name="calendar">The calendar that is used to interpret <paramref name="year" />, <paramref name="month" />, and <paramref name="day" />. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="calendar" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="year" /> is not in the range supported by <paramref name="calendar" />.-or- <paramref name="month" /> is less than 1 or greater than the number of months in <paramref name="calendar" />.-or- <paramref name="day" /> is less than 1 or greater than the number of days in <paramref name="month" />.-or- <paramref name="hour" /> is less than 0 or greater than 23 -or- <paramref name="minute" /> is less than 0 or greater than 59. -or- <paramref name="second" /> is less than 0 or greater than 59. </exception>
/// <exception cref="T:System.ArgumentException">The specified parameters evaluate to less than <see cref="F:System.DateTime.MinValue" /> or more than <see cref="F:System.DateTime.MaxValue" />. </exception>
// Token: 0x06003D29 RID: 15657 RVA: 0x000CDD2C File Offset: 0x000CBF2C
public DateTime(int year, int month, int day, int hour, int minute, int second, Calendar calendar)
{
this = new DateTime(year, month, day, hour, minute, second, 0, calendar);
}
/// <summary>Initializes a new instance of the <see cref="T:System.DateTime" /> structure to the specified year, month, day, hour, minute, second, and millisecond for the specified calendar.</summary>
/// <param name="year">The year (1 through the number of years in <paramref name="calendar" />). </param>
/// <param name="month">The month (1 through the number of months in <paramref name="calendar" />). </param>
/// <param name="day">The day (1 through the number of days in <paramref name="month" />). </param>
/// <param name="hour">The hours (0 through 23). </param>
/// <param name="minute">The minutes (0 through 59). </param>
/// <param name="second">The seconds (0 through 59). </param>
/// <param name="millisecond">The milliseconds (0 through 999). </param>
/// <param name="calendar">The calendar that is used to interpret <paramref name="year" />, <paramref name="month" />, and <paramref name="day" />. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="calendar" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="year" /> is not in the range supported by <paramref name="calendar" />.-or- <paramref name="month" /> is less than 1 or greater than the number of months in <paramref name="calendar" />.-or- <paramref name="day" /> is less than 1 or greater than the number of days in <paramref name="month" />.-or- <paramref name="hour" /> is less than 0 or greater than 23.-or- <paramref name="minute" /> is less than 0 or greater than 59.-or- <paramref name="second" /> is less than 0 or greater than 59.-or- <paramref name="millisecond" /> is less than 0 or greater than 999. </exception>
/// <exception cref="T:System.ArgumentException">The specified parameters evaluate to less than <see cref="F:System.DateTime.MinValue" /> or more than <see cref="F:System.DateTime.MaxValue" />. </exception>
// Token: 0x06003D2A RID: 15658 RVA: 0x000CDD4C File Offset: 0x000CBF4C
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar)
{
if (calendar == null)
{
throw new ArgumentNullException("calendar");
}
this.ticks = calendar.ToDateTime(year, month, day, hour, minute, second, millisecond).ticks;
this.kind = DateTimeKind.Unspecified;
}
// Token: 0x06003D2B RID: 15659 RVA: 0x000CDD94 File Offset: 0x000CBF94
internal DateTime(bool check, TimeSpan value)
{
if (check && (value.Ticks < DateTime.MinValue.Ticks || value.Ticks > DateTime.MaxValue.Ticks))
{
throw new ArgumentOutOfRangeException();
}
this.ticks = value;
this.kind = DateTimeKind.Unspecified;
}
/// <summary>Initializes a new instance of the <see cref="T:System.DateTime" /> structure to a specified number of ticks and to Coordinated Universal Time (UTC) or local time.</summary>
/// <param name="ticks">A date and time expressed in the number of 100-nanosecond intervals that have elapsed since January 1, 0001 at 00:00:00.000 in the Gregorian calendar. </param>
/// <param name="kind">One of the enumeration values that indicates whether <paramref name="ticks" /> specifies a local time, Coordinated Universal Time (UTC), or neither.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="ticks" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="kind" /> is not one of the <see cref="T:System.DateTimeKind" /> values.</exception>
// Token: 0x06003D2C RID: 15660 RVA: 0x000CDDF0 File Offset: 0x000CBFF0
public DateTime(long ticks, DateTimeKind kind)
{
this = new DateTime(ticks);
this.CheckDateTimeKind(kind);
this.kind = kind;
}
/// <summary>Initializes a new instance of the <see cref="T:System.DateTime" /> structure to the specified year, month, day, hour, minute, second, and Coordinated Universal Time (UTC) or local time.</summary>
/// <param name="year">The year (1 through 9999). </param>
/// <param name="month">The month (1 through 12). </param>
/// <param name="day">The day (1 through the number of days in <paramref name="month" />). </param>
/// <param name="hour">The hours (0 through 23). </param>
/// <param name="minute">The minutes (0 through 59). </param>
/// <param name="second">The seconds (0 through 59). </param>
/// <param name="kind">One of the enumeration values that indicates whether <paramref name="year" />, <paramref name="month" />, <paramref name="day" />, <paramref name="hour" />, <paramref name="minute" /> and <paramref name="second" /> specify a local time, Coordinated Universal Time (UTC), or neither.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="year" /> is less than 1 or greater than 9999. -or- <paramref name="month" /> is less than 1 or greater than 12. -or- <paramref name="day" /> is less than 1 or greater than the number of days in <paramref name="month" />.-or- <paramref name="hour" /> is less than 0 or greater than 23. -or- <paramref name="minute" /> is less than 0 or greater than 59. -or- <paramref name="second" /> is less than 0 or greater than 59. </exception>
/// <exception cref="T:System.ArgumentException">The specified time parameters evaluate to less than <see cref="F:System.DateTime.MinValue" /> or more than <see cref="F:System.DateTime.MaxValue" />. -or-<paramref name="kind" /> is not one of the <see cref="T:System.DateTimeKind" /> values.</exception>
// Token: 0x06003D2D RID: 15661 RVA: 0x000CDE08 File Offset: 0x000CC008
public DateTime(int year, int month, int day, int hour, int minute, int second, DateTimeKind kind)
{
this = new DateTime(year, month, day, hour, minute, second);
this.CheckDateTimeKind(kind);
this.kind = kind;
}
/// <summary>Initializes a new instance of the <see cref="T:System.DateTime" /> structure to the specified year, month, day, hour, minute, second, millisecond, and Coordinated Universal Time (UTC) or local time.</summary>
/// <param name="year">The year (1 through 9999). </param>
/// <param name="month">The month (1 through 12). </param>
/// <param name="day">The day (1 through the number of days in <paramref name="month" />). </param>
/// <param name="hour">The hours (0 through 23). </param>
/// <param name="minute">The minutes (0 through 59). </param>
/// <param name="second">The seconds (0 through 59). </param>
/// <param name="millisecond">The milliseconds (0 through 999). </param>
/// <param name="kind">One of the enumeration values that indicates whether <paramref name="year" />, <paramref name="month" />, <paramref name="day" />, <paramref name="hour" />, <paramref name="minute" />, <paramref name="second" />, and <paramref name="millisecond" /> specify a local time, Coordinated Universal Time (UTC), or neither.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="year" /> is less than 1 or greater than 9999.-or- <paramref name="month" /> is less than 1 or greater than 12.-or- <paramref name="day" /> is less than 1 or greater than the number of days in <paramref name="month" />.-or- <paramref name="hour" /> is less than 0 or greater than 23.-or- <paramref name="minute" /> is less than 0 or greater than 59.-or- <paramref name="second" /> is less than 0 or greater than 59.-or- <paramref name="millisecond" /> is less than 0 or greater than 999. </exception>
/// <exception cref="T:System.ArgumentException">The specified time parameters evaluate to less than <see cref="F:System.DateTime.MinValue" /> or more than <see cref="F:System.DateTime.MaxValue" />. -or-<paramref name="kind" /> is not one of the <see cref="T:System.DateTimeKind" /> values.</exception>
// Token: 0x06003D2E RID: 15662 RVA: 0x000CDE2C File Offset: 0x000CC02C
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, DateTimeKind kind)
{
this = new DateTime(year, month, day, hour, minute, second, millisecond);
this.CheckDateTimeKind(kind);
this.kind = kind;
}
/// <summary>Initializes a new instance of the <see cref="T:System.DateTime" /> structure to the specified year, month, day, hour, minute, second, millisecond, and Coordinated Universal Time (UTC) or local time for the specified calendar.</summary>
/// <param name="year">The year (1 through the number of years in <paramref name="calendar" />). </param>
/// <param name="month">The month (1 through the number of months in <paramref name="calendar" />). </param>
/// <param name="day">The day (1 through the number of days in <paramref name="month" />). </param>
/// <param name="hour">The hours (0 through 23). </param>
/// <param name="minute">The minutes (0 through 59). </param>
/// <param name="second">The seconds (0 through 59). </param>
/// <param name="millisecond">The milliseconds (0 through 999). </param>
/// <param name="calendar">The calendar that is used to interpret <paramref name="year" />, <paramref name="month" />, and <paramref name="day" />.</param>
/// <param name="kind">One of the enumeration values that indicates whether <paramref name="year" />, <paramref name="month" />, <paramref name="day" />, <paramref name="hour" />, <paramref name="minute" />, <paramref name="second" />, and <paramref name="millisecond" /> specify a local time, Coordinated Universal Time (UTC), or neither.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="calendar" /> is null. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="year" /> is not in the range supported by <paramref name="calendar" />.-or- <paramref name="month" /> is less than 1 or greater than the number of months in <paramref name="calendar" />.-or- <paramref name="day" /> is less than 1 or greater than the number of days in <paramref name="month" />.-or- <paramref name="hour" /> is less than 0 or greater than 23.-or- <paramref name="minute" /> is less than 0 or greater than 59.-or- <paramref name="second" /> is less than 0 or greater than 59.-or- <paramref name="millisecond" /> is less than 0 or greater than 999. </exception>
/// <exception cref="T:System.ArgumentException">The specified time parameters evaluate to less than <see cref="F:System.DateTime.MinValue" /> or more than <see cref="F:System.DateTime.MaxValue" />. -or-<paramref name="kind" /> is not one of the <see cref="T:System.DateTimeKind" /> values.</exception>
// Token: 0x06003D2F RID: 15663 RVA: 0x000CDE5C File Offset: 0x000CC05C
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar, DateTimeKind kind)
{
this = new DateTime(year, month, day, hour, minute, second, millisecond, calendar);
this.CheckDateTimeKind(kind);
this.kind = kind;
}
// Token: 0x06003D30 RID: 15664 RVA: 0x000CDE8C File Offset: 0x000CC08C
static DateTime()
{
if (MonoTouchAOTHelper.FalseFlag)
{
GenericComparer<DateTime> genericComparer = new GenericComparer<DateTime>();
GenericEqualityComparer<DateTime> genericEqualityComparer = new GenericEqualityComparer<DateTime>();
}
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D31 RID: 15665 RVA: 0x000CE184 File Offset: 0x000CC384
bool IConvertible.ToBoolean(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D32 RID: 15666 RVA: 0x000CE18C File Offset: 0x000CC38C
byte IConvertible.ToByte(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D33 RID: 15667 RVA: 0x000CE194 File Offset: 0x000CC394
char IConvertible.ToChar(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>Returns the current <see cref="T:System.DateTime" /> object.</summary>
/// <returns>The current <see cref="T:System.DateTime" /> object.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
// Token: 0x06003D34 RID: 15668 RVA: 0x000CE19C File Offset: 0x000CC39C
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
return this;
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface or null.</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D35 RID: 15669 RVA: 0x000CE1A4 File Offset: 0x000CC3A4
decimal IConvertible.ToDecimal(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D36 RID: 15670 RVA: 0x000CE1AC File Offset: 0x000CC3AC
double IConvertible.ToDouble(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D37 RID: 15671 RVA: 0x000CE1B4 File Offset: 0x000CC3B4
short IConvertible.ToInt16(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D38 RID: 15672 RVA: 0x000CE1BC File Offset: 0x000CC3BC
int IConvertible.ToInt32(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D39 RID: 15673 RVA: 0x000CE1C4 File Offset: 0x000CC3C4
long IConvertible.ToInt64(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D3A RID: 15674 RVA: 0x000CE1CC File Offset: 0x000CC3CC
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases. </exception>
// Token: 0x06003D3B RID: 15675 RVA: 0x000CE1D4 File Offset: 0x000CC3D4
float IConvertible.ToSingle(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>Converts the current <see cref="T:System.DateTime" /> object to an object of a specified type.</summary>
/// <returns>An object of the type specified by the <paramref name="type" /> parameter, with a value equivalent to the current <see cref="T:System.DateTime" /> object.</returns>
/// <param name="type">The desired type. </param>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="type" /> is null. </exception>
/// <exception cref="T:System.InvalidCastException">This conversion is not supported for the <see cref="T:System.DateTime" /> type.</exception>
// Token: 0x06003D3C RID: 15676 RVA: 0x000CE1DC File Offset: 0x000CC3DC
object IConvertible.ToType(Type targetType, IFormatProvider provider)
{
if (targetType == null)
{
throw new ArgumentNullException("targetType");
}
if (targetType == typeof(DateTime))
{
return this;
}
if (targetType == typeof(string))
{
return this.ToString(provider);
}
if (targetType == typeof(object))
{
return this;
}
throw new InvalidCastException();
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D3D RID: 15677 RVA: 0x000CE250 File Offset: 0x000CC450
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D3E RID: 15678 RVA: 0x000CE258 File Offset: 0x000CC458
uint IConvertible.ToUInt32(IFormatProvider provider)
{
throw new InvalidCastException();
}
/// <summary>This conversion is not supported. Attempting to use this method throws an <see cref="T:System.InvalidCastException" />.</summary>
/// <returns>The return value for this member is not used.</returns>
/// <param name="provider">An object that implements the <see cref="T:System.IFormatProvider" /> interface. (This parameter is not used; specify null.)</param>
/// <exception cref="T:System.InvalidCastException">In all cases.</exception>
// Token: 0x06003D3F RID: 15679 RVA: 0x000CE260 File Offset: 0x000CC460
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
throw new InvalidCastException();
}
// Token: 0x06003D40 RID: 15680 RVA: 0x000CE268 File Offset: 0x000CC468
private static int AbsoluteDays(int year, int month, int day)
{
int num = 0;
int i = 1;
int[] array = ((!DateTime.IsLeapYear(year)) ? DateTime.daysmonth : DateTime.daysmonthleap);
while (i < month)
{
num += array[i++];
}
return day - 1 + num + 365 * (year - 1) + (year - 1) / 4 - (year - 1) / 100 + (year - 1) / 400;
}
// Token: 0x06003D41 RID: 15681 RVA: 0x000CE2D0 File Offset: 0x000CC4D0
private int FromTicks(DateTime.Which what)
{
int num = 1;
int[] array = DateTime.daysmonth;
int i = this.ticks.Days;
int num2 = i / 146097;
i -= num2 * 146097;
int num3 = i / 36524;
if (num3 == 4)
{
num3 = 3;
}
i -= num3 * 36524;
int num4 = i / 1461;
i -= num4 * 1461;
int num5 = i / 365;
if (num5 == 4)
{
num5 = 3;
}
if (what == DateTime.Which.Year)
{
return num2 * 400 + num3 * 100 + num4 * 4 + num5 + 1;
}
i -= num5 * 365;
if (what == DateTime.Which.DayYear)
{
return i + 1;
}
if (num5 == 3 && (num3 == 3 || num4 != 24))
{
array = DateTime.daysmonthleap;
}
while (i >= array[num])
{
i -= array[num++];
}
if (what == DateTime.Which.Month)
{
return num;
}
return i + 1;
}
/// <summary>Gets the date component of this instance.</summary>
/// <returns>A new <see cref="T:System.DateTime" /> with the same date as this instance, and the time value set to 12:00:00 midnight (00:00:00).</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B67 RID: 2919
// (get) Token: 0x06003D42 RID: 15682 RVA: 0x000CE3D0 File Offset: 0x000CC5D0
public DateTime Date
{
get
{
return new DateTime(this.Year, this.Month, this.Day)
{
kind = this.kind
};
}
}
/// <summary>Gets the month component of the date represented by this instance.</summary>
/// <returns>The month component, expressed as a value between 1 and 12.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B68 RID: 2920
// (get) Token: 0x06003D43 RID: 15683 RVA: 0x000CE404 File Offset: 0x000CC604
public int Month
{
get
{
return this.FromTicks(DateTime.Which.Month);
}
}
/// <summary>Gets the day of the month represented by this instance.</summary>
/// <returns>The day component, expressed as a value between 1 and 31.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B69 RID: 2921
// (get) Token: 0x06003D44 RID: 15684 RVA: 0x000CE410 File Offset: 0x000CC610
public int Day
{
get
{
return this.FromTicks(DateTime.Which.Day);
}
}
/// <summary>Gets the day of the week represented by this instance.</summary>
/// <returns>A <see cref="T:System.DayOfWeek" /> enumerated constant that indicates the day of the week of this <see cref="T:System.DateTime" /> value. </returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B6A RID: 2922
// (get) Token: 0x06003D45 RID: 15685 RVA: 0x000CE41C File Offset: 0x000CC61C
public DayOfWeek DayOfWeek
{
get
{
return (this.ticks.Days + DayOfWeek.Monday) % (DayOfWeek)7;
}
}
/// <summary>Gets the day of the year represented by this instance.</summary>
/// <returns>The day of the year, expressed as a value between 1 and 366.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B6B RID: 2923
// (get) Token: 0x06003D46 RID: 15686 RVA: 0x000CE430 File Offset: 0x000CC630
public int DayOfYear
{
get
{
return this.FromTicks(DateTime.Which.DayYear);
}
}
/// <summary>Gets the time of day for this instance.</summary>
/// <returns>A <see cref="T:System.TimeSpan" /> that represents the fraction of the day that has elapsed since midnight.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B6C RID: 2924
// (get) Token: 0x06003D47 RID: 15687 RVA: 0x000CE43C File Offset: 0x000CC63C
public TimeSpan TimeOfDay
{
get
{
return new TimeSpan(this.ticks.Ticks % 864000000000L);
}
}
/// <summary>Gets the hour component of the date represented by this instance.</summary>
/// <returns>The hour component, expressed as a value between 0 and 23.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B6D RID: 2925
// (get) Token: 0x06003D48 RID: 15688 RVA: 0x000CE458 File Offset: 0x000CC658
public int Hour
{
get
{
return this.ticks.Hours;
}
}
/// <summary>Gets the minute component of the date represented by this instance.</summary>
/// <returns>The minute component, expressed as a value between 0 and 59.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B6E RID: 2926
// (get) Token: 0x06003D49 RID: 15689 RVA: 0x000CE468 File Offset: 0x000CC668
public int Minute
{
get
{
return this.ticks.Minutes;
}
}
/// <summary>Gets the seconds component of the date represented by this instance.</summary>
/// <returns>The seconds, between 0 and 59.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B6F RID: 2927
// (get) Token: 0x06003D4A RID: 15690 RVA: 0x000CE478 File Offset: 0x000CC678
public int Second
{
get
{
return this.ticks.Seconds;
}
}
/// <summary>Gets the milliseconds component of the date represented by this instance.</summary>
/// <returns>The milliseconds component, expressed as a value between 0 and 999.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B70 RID: 2928
// (get) Token: 0x06003D4B RID: 15691 RVA: 0x000CE488 File Offset: 0x000CC688
public int Millisecond
{
get
{
return this.ticks.Milliseconds;
}
}
// Token: 0x06003D4C RID: 15692
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern long GetTimeMonotonic();
// Token: 0x06003D4D RID: 15693
[MethodImpl(MethodImplOptions.InternalCall)]
internal static extern long GetNow();
/// <summary>Gets a <see cref="T:System.DateTime" /> object that is set to the current date and time on this computer, expressed as the local time.</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the current local date and time.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B71 RID: 2929
// (get) Token: 0x06003D4E RID: 15694 RVA: 0x000CE498 File Offset: 0x000CC698
public static DateTime Now
{
get
{
long now = DateTime.GetNow();
DateTime dateTime = new DateTime(now);
if (now - DateTime.last_now > 600000000L)
{
DateTime.to_local_time_span_object = TimeZone.CurrentTimeZone.GetLocalTimeDiff(dateTime);
DateTime.last_now = now;
}
DateTime dateTime2 = dateTime + (TimeSpan)DateTime.to_local_time_span_object;
dateTime2.kind = DateTimeKind.Local;
return dateTime2;
}
}
/// <summary>Gets the number of ticks that represent the date and time of this instance.</summary>
/// <returns>The number of ticks that represent the date and time of this instance. The value is between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B72 RID: 2930
// (get) Token: 0x06003D4F RID: 15695 RVA: 0x000CE4FC File Offset: 0x000CC6FC
public long Ticks
{
get
{
return this.ticks.Ticks;
}
}
/// <summary>Gets the current date.</summary>
/// <returns>A <see cref="T:System.DateTime" /> set to today's date, with the time component set to 00:00:00.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B73 RID: 2931
// (get) Token: 0x06003D50 RID: 15696 RVA: 0x000CE50C File Offset: 0x000CC70C
public static DateTime Today
{
get
{
DateTime now = DateTime.Now;
return new DateTime(now.Year, now.Month, now.Day)
{
kind = now.kind
};
}
}
/// <summary>Gets a <see cref="T:System.DateTime" /> object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC).</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the current UTC date and time.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B74 RID: 2932
// (get) Token: 0x06003D51 RID: 15697 RVA: 0x000CE54C File Offset: 0x000CC74C
public static DateTime UtcNow
{
get
{
return new DateTime(DateTime.GetNow(), DateTimeKind.Utc);
}
}
/// <summary>Gets the year component of the date represented by this instance.</summary>
/// <returns>The year, between 1 and 9999.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B75 RID: 2933
// (get) Token: 0x06003D52 RID: 15698 RVA: 0x000CE55C File Offset: 0x000CC75C
public int Year
{
get
{
return this.FromTicks(DateTime.Which.Year);
}
}
/// <summary>Gets a value that indicates whether the time represented by this instance is based on local time, Coordinated Universal Time (UTC), or neither.</summary>
/// <returns>One of the T:System.DateTimeKind values. The default is <see cref="F:System.DateTimeKind.Unspecified" />.</returns>
/// <filterpriority>1</filterpriority>
// Token: 0x17000B76 RID: 2934
// (get) Token: 0x06003D53 RID: 15699 RVA: 0x000CE568 File Offset: 0x000CC768
public DateTimeKind Kind
{
get
{
return this.kind;
}
}
/// <summary>Returns a new <see cref="T:System.DateTime" /> that adds the value of the specified <see cref="T:System.TimeSpan" /> to the value of this instance.</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the sum of the date and time represented by this instance and the time interval represented by <paramref name="value" />.</returns>
/// <param name="value">A <see cref="T:System.TimeSpan" /> object that represents a positive or negative time interval. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D54 RID: 15700 RVA: 0x000CE570 File Offset: 0x000CC770
public DateTime Add(TimeSpan value)
{
DateTime dateTime = this.AddTicks(value.Ticks);
dateTime.kind = this.kind;
return dateTime;
}
/// <summary>Returns a new <see cref="T:System.DateTime" /> that adds the specified number of days to the value of this instance.</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the sum of the date and time represented by this instance and the number of days represented by <paramref name="value" />.</returns>
/// <param name="value">A number of whole and fractional days. The <paramref name="value" /> parameter can be negative or positive. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D55 RID: 15701 RVA: 0x000CE59C File Offset: 0x000CC79C
public DateTime AddDays(double value)
{
return this.AddMilliseconds(Math.Round(value * 86400000.0));
}
/// <summary>Returns a new <see cref="T:System.DateTime" /> that adds the specified number of ticks to the value of this instance.</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the sum of the date and time represented by this instance and the time represented by <paramref name="value" />.</returns>
/// <param name="value">A number of 100-nanosecond ticks. The <paramref name="value" /> parameter can be positive or negative. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D56 RID: 15702 RVA: 0x000CE5B4 File Offset: 0x000CC7B4
public DateTime AddTicks(long value)
{
if (value + this.ticks.Ticks > 3155378975999999999L || value + this.ticks.Ticks < 0L)
{
throw new ArgumentOutOfRangeException();
}
return new DateTime(value + this.ticks.Ticks)
{
kind = this.kind
};
}
/// <summary>Returns a new <see cref="T:System.DateTime" /> that adds the specified number of hours to the value of this instance.</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the sum of the date and time represented by this instance and the number of hours represented by <paramref name="value" />.</returns>
/// <param name="value">A number of whole and fractional hours. The <paramref name="value" /> parameter can be negative or positive. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D57 RID: 15703 RVA: 0x000CE618 File Offset: 0x000CC818
public DateTime AddHours(double value)
{
return this.AddMilliseconds(value * 3600000.0);
}
/// <summary>Returns a new <see cref="T:System.DateTime" /> that adds the specified number of milliseconds to the value of this instance.</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the sum of the date and time represented by this instance and the number of milliseconds represented by <paramref name="value" />.</returns>
/// <param name="value">A number of whole and fractional milliseconds. The <paramref name="value" /> parameter can be negative or positive. Note that this value is rounded to the nearest integer.</param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D58 RID: 15704 RVA: 0x000CE62C File Offset: 0x000CC82C
public DateTime AddMilliseconds(double value)
{
if (value * 10000.0 > 9.223372036854776E+18 || value * 10000.0 < -9.223372036854776E+18)
{
throw new ArgumentOutOfRangeException();
}
long num = (long)Math.Round(value * 10000.0);
return this.AddTicks(num);
}
// Token: 0x06003D59 RID: 15705 RVA: 0x000CE68C File Offset: 0x000CC88C
private DateTime AddRoundedMilliseconds(double ms)
{
if (ms * 10000.0 > 9.223372036854776E+18 || ms * 10000.0 < -9.223372036854776E+18)
{
throw new ArgumentOutOfRangeException();
}
long num = (long)(ms += ((ms <= 0.0) ? (-0.5) : 0.5)) * 10000L;
return this.AddTicks(num);
}
/// <summary>Returns a new <see cref="T:System.DateTime" /> that adds the specified number of minutes to the value of this instance.</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the sum of the date and time represented by this instance and the number of minutes represented by <paramref name="value" />.</returns>
/// <param name="value">A number of whole and fractional minutes. The <paramref name="value" /> parameter can be negative or positive. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D5A RID: 15706 RVA: 0x000CE70C File Offset: 0x000CC90C
public DateTime AddMinutes(double value)
{
return this.AddMilliseconds(value * 60000.0);
}
/// <summary>Returns a new <see cref="T:System.DateTime" /> that adds the specified number of months to the value of this instance.</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the sum of the date and time represented by this instance and <paramref name="months" />.</returns>
/// <param name="months">A number of months. The <paramref name="months" /> parameter can be negative or positive. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />.-or- <paramref name="months" /> is less than -120,000 or greater than 120,000. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D5B RID: 15707 RVA: 0x000CE720 File Offset: 0x000CC920
public DateTime AddMonths(int months)
{
int num = this.Day;
int num2 = this.Month + months % 12;
int num3 = this.Year + months / 12;
if (num2 < 1)
{
num2 = 12 + num2;
num3--;
}
else if (num2 > 12)
{
num2 -= 12;
num3++;
}
int num4 = DateTime.DaysInMonth(num3, num2);
if (num > num4)
{
num = num4;
}
DateTime dateTime = new DateTime(num3, num2, num);
dateTime.kind = this.kind;
return dateTime.Add(this.TimeOfDay);
}
/// <summary>Returns a new <see cref="T:System.DateTime" /> that adds the specified number of seconds to the value of this instance.</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the sum of the date and time represented by this instance and the number of seconds represented by <paramref name="value" />.</returns>
/// <param name="value">A number of whole and fractional seconds. The <paramref name="value" /> parameter can be negative or positive. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D5C RID: 15708 RVA: 0x000CE7A8 File Offset: 0x000CC9A8
public DateTime AddSeconds(double value)
{
return this.AddMilliseconds(value * 1000.0);
}
/// <summary>Returns a new <see cref="T:System.DateTime" /> that adds the specified number of years to the value of this instance.</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the sum of the date and time represented by this instance and the number of years represented by <paramref name="value" />.</returns>
/// <param name="value">A number of years. The <paramref name="value" /> parameter can be negative or positive. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="value" /> or the resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D5D RID: 15709 RVA: 0x000CE7BC File Offset: 0x000CC9BC
public DateTime AddYears(int value)
{
return this.AddMonths(value * 12);
}
/// <summary>Compares two instances of <see cref="T:System.DateTime" /> and returns an integer that indicates whether the first instance is earlier than, the same as, or later than the second instance.</summary>
/// <returns>A signed number indicating the relative values of <paramref name="t1" /> and <paramref name="t2" />.Value Type Condition Less than zero <paramref name="t1" /> is earlier than <paramref name="t2" />. Zero <paramref name="t1" /> is the same as <paramref name="t2" />. Greater than zero <paramref name="t1" /> is later than <paramref name="t2" />. </returns>
/// <param name="t1">The first object to compare. </param>
/// <param name="t2">The second object to compare.</param>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D5E RID: 15710 RVA: 0x000CE7C8 File Offset: 0x000CC9C8
public static int Compare(DateTime t1, DateTime t2)
{
if (t1.ticks < t2.ticks)
{
return -1;
}
if (t1.ticks > t2.ticks)
{
return 1;
}
return 0;
}
/// <summary>Compares the value of this instance to a specified object that contains a specified <see cref="T:System.DateTime" /> value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified <see cref="T:System.DateTime" /> value.</summary>
/// <returns>A signed number indicating the relative values of this instance and <paramref name="value" />.Value Description Less than zero This instance is earlier than <paramref name="value" />. Zero This instance is the same as <paramref name="value" />. Greater than zero This instance is later than <paramref name="value" />, or <paramref name="value" /> is null. </returns>
/// <param name="value">A boxed object to compare, or null. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="value" /> is not a <see cref="T:System.DateTime" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D5F RID: 15711 RVA: 0x000CE800 File Offset: 0x000CCA00
public int CompareTo(object value)
{
if (value == null)
{
return 1;
}
if (!(value is DateTime))
{
throw new ArgumentException(Locale.GetText("Value is not a System.DateTime"));
}
return DateTime.Compare(this, (DateTime)value);
}
/// <summary>Indicates whether this instance of <see cref="T:System.DateTime" /> is within the Daylight Saving Time range for the current time zone.</summary>
/// <returns>true if <see cref="P:System.DateTime.Kind" /> is <see cref="F:System.DateTimeKind.Local" /> or <see cref="F:System.DateTimeKind.Unspecified" /> and the value of this instance of <see cref="T:System.DateTime" /> is within the Daylight Saving Time range for the current time zone. false if <see cref="P:System.DateTime.Kind" /> is <see cref="F:System.DateTimeKind.Utc" />.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D60 RID: 15712 RVA: 0x000CE844 File Offset: 0x000CCA44
public bool IsDaylightSavingTime()
{
return this.kind != DateTimeKind.Utc && TimeZone.CurrentTimeZone.IsDaylightSavingTime(this);
}
/// <summary>Compares the value of this instance to a specified <see cref="T:System.DateTime" /> value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified <see cref="T:System.DateTime" /> value.</summary>
/// <returns>A signed number indicating the relative values of this instance and the <paramref name="value" /> parameter.Value Description Less than zero This instance is earlier than <paramref name="value" />. Zero This instance is the same as <paramref name="value" />. Greater than zero This instance is later than <paramref name="value" />. </returns>
/// <param name="value">The object to compare to the current instance. </param>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D61 RID: 15713 RVA: 0x000CE864 File Offset: 0x000CCA64
public int CompareTo(DateTime value)
{
return DateTime.Compare(this, value);
}
/// <summary>Returns a value indicating whether this instance is equal to the specified <see cref="T:System.DateTime" /> instance.</summary>
/// <returns>true if the <paramref name="value" /> parameter equals the value of this instance; otherwise, false.</returns>
/// <param name="value">The object to compare to this instance. </param>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D62 RID: 15714 RVA: 0x000CE874 File Offset: 0x000CCA74
public bool Equals(DateTime value)
{
return value.ticks == this.ticks;
}
/// <summary>Serializes the current <see cref="T:System.DateTime" /> object to a 64-bit binary value that subsequently can be used to recreate the <see cref="T:System.DateTime" /> object.</summary>
/// <returns>A 64-bit signed integer that encodes the <see cref="P:System.DateTime.Kind" /> and <see cref="P:System.DateTime.Ticks" /> properties. </returns>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D63 RID: 15715 RVA: 0x000CE888 File Offset: 0x000CCA88
public long ToBinary()
{
DateTimeKind dateTimeKind = this.kind;
if (dateTimeKind == DateTimeKind.Utc)
{
return this.Ticks | 4611686018427387904L;
}
if (dateTimeKind != DateTimeKind.Local)
{
return this.Ticks;
}
return this.ToUniversalTime().Ticks | long.MinValue;
}
/// <summary>Deserializes a 64-bit binary value and recreates an original serialized <see cref="T:System.DateTime" /> object.</summary>
/// <returns>A <see cref="T:System.DateTime" /> object that is equivalent to the <see cref="T:System.DateTime" /> object that was serialized by the <see cref="M:System.DateTime.ToBinary" /> method.</returns>
/// <param name="dateData">A 64-bit signed integer that encodes the <see cref="P:System.DateTime.Kind" /> property in a 2-bit field and the <see cref="P:System.DateTime.Ticks" /> property in a 62-bit field. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="dateData" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D64 RID: 15716 RVA: 0x000CE8E0 File Offset: 0x000CCAE0
public static DateTime FromBinary(long dateData)
{
ulong num = (ulong)dateData >> 62;
if (num == (ulong)0)
{
return new DateTime(dateData, DateTimeKind.Unspecified);
}
if (num != (ulong)1)
{
DateTime dateTime = new DateTime(dateData & 4611686018427387903L, DateTimeKind.Utc);
return dateTime.ToLocalTime();
}
return new DateTime(dateData ^ 4611686018427387904L, DateTimeKind.Utc);
}
/// <summary>Creates a new <see cref="T:System.DateTime" /> object that has the same number of ticks as the specified <see cref="T:System.DateTime" />, but is designated as either local time, Coordinated Universal Time (UTC), or neither, as indicated by the specified <see cref="T:System.DateTimeKind" /> value.</summary>
/// <returns>A new object that has the same number of ticks as the object represented by the <paramref name="value" /> parameter and the <see cref="T:System.DateTimeKind" /> value specified by the <paramref name="kind" /> parameter.</returns>
/// <param name="value">A <see cref="T:System.DateTime" /> object.</param>
/// <param name="kind">One of the <see cref="T:System.DateTimeKind" /> values.</param>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D65 RID: 15717 RVA: 0x000CE93C File Offset: 0x000CCB3C
public static DateTime SpecifyKind(DateTime value, DateTimeKind kind)
{
return new DateTime(value.Ticks, kind);
}
/// <summary>Returns the number of days in the specified month and year.</summary>
/// <returns>The number of days in <paramref name="month" /> for the specified <paramref name="year" />.For example, if <paramref name="month" /> equals 2 for February, the return value is 28 or 29 depending upon whether <paramref name="year" /> is a leap year.</returns>
/// <param name="year">The year. </param>
/// <param name="month">The month (a number ranging from 1 to 12). </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="month" /> is less than 1 or greater than 12.-or-<paramref name="year" /> is less than 1 or greater than 9999.</exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D66 RID: 15718 RVA: 0x000CE94C File Offset: 0x000CCB4C
public static int DaysInMonth(int year, int month)
{
if (month < 1 || month > 12)
{
throw new ArgumentOutOfRangeException();
}
if (year < 1 || year > 9999)
{
throw new ArgumentOutOfRangeException();
}
int[] array = ((!DateTime.IsLeapYear(year)) ? DateTime.daysmonth : DateTime.daysmonthleap);
return array[month];
}
/// <summary>Returns a value indicating whether this instance is equal to a specified object.</summary>
/// <returns>true if <paramref name="value" /> is an instance of <see cref="T:System.DateTime" /> and equals the value of this instance; otherwise, false.</returns>
/// <param name="value">An object to compare to this instance. </param>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D67 RID: 15719 RVA: 0x000CE9A4 File Offset: 0x000CCBA4
public override bool Equals(object value)
{
return value is DateTime && ((DateTime)value).ticks == this.ticks;
}
/// <summary>Returns a value indicating whether two instances of <see cref="T:System.DateTime" /> are equal.</summary>
/// <returns>true if the two values are equal; otherwise, false.</returns>
/// <param name="t1">The first object to compare.</param>
/// <param name="t2">The second object to compare.</param>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D68 RID: 15720 RVA: 0x000CE9D8 File Offset: 0x000CCBD8
public static bool Equals(DateTime t1, DateTime t2)
{
return t1.ticks == t2.ticks;
}
/// <summary>Converts the specified Windows file time to an equivalent local time.</summary>
/// <returns>A <see cref="T:System.DateTime" /> object that represents a local time equivalent to the date and time represented by the <paramref name="fileTime" /> parameter.</returns>
/// <param name="fileTime">A Windows file time expressed in ticks. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="fileTime" /> is less than 0 or represents a time greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D69 RID: 15721 RVA: 0x000CE9F0 File Offset: 0x000CCBF0
public static DateTime FromFileTime(long fileTime)
{
if (fileTime < 0L)
{
throw new ArgumentOutOfRangeException("fileTime", "< 0");
}
DateTime dateTime = new DateTime(504911232000000000L + fileTime);
return dateTime.ToLocalTime();
}
/// <summary>Converts the specified Windows file time to an equivalent UTC time.</summary>
/// <returns>A <see cref="T:System.DateTime" /> object that represents a UTC time equivalent to the date and time represented by the <paramref name="fileTime" /> parameter.</returns>
/// <param name="fileTime">A Windows file time expressed in ticks. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="fileTime" /> is less than 0 or represents a time greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D6A RID: 15722 RVA: 0x000CEA30 File Offset: 0x000CCC30
public static DateTime FromFileTimeUtc(long fileTime)
{
if (fileTime < 0L)
{
throw new ArgumentOutOfRangeException("fileTime", "< 0");
}
return new DateTime(504911232000000000L + fileTime);
}
/// <summary>Returns a <see cref="T:System.DateTime" /> equivalent to the specified OLE Automation date.</summary>
/// <returns>A <see cref="T:System.DateTime" /> that represents the same date and time as <paramref name="d" />.</returns>
/// <param name="d">An OLE Automation date value. </param>
/// <exception cref="T:System.ArgumentException">The date is not a valid OLE Automation date value. </exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D6B RID: 15723 RVA: 0x000CEA68 File Offset: 0x000CCC68
public static DateTime FromOADate(double d)
{
if (d <= -657435.0 || d >= 2958466.0)
{
throw new ArgumentException("d", "[-657435,2958466]");
}
DateTime dateTime = new DateTime(599264352000000000L);
if (d < 0.0)
{
double num = Math.Ceiling(d);
dateTime = dateTime.AddRoundedMilliseconds(num * 86400000.0);
double num2 = num - d;
dateTime = dateTime.AddRoundedMilliseconds(num2 * 86400000.0);
}
else
{
dateTime = dateTime.AddRoundedMilliseconds(d * 86400000.0);
}
return dateTime;
}
/// <summary>Converts the value of this instance to all the string representations supported by the standard date and time format specifiers.</summary>
/// <returns>A string array where each element is the representation of the value of this instance formatted with one of the standard date and time format specifiers.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D6C RID: 15724 RVA: 0x000CEB0C File Offset: 0x000CCD0C
public string[] GetDateTimeFormats()
{
return this.GetDateTimeFormats(CultureInfo.CurrentCulture);
}
/// <summary>Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier.</summary>
/// <returns>A string array where each element is the representation of the value of this instance formatted with the <paramref name="format" /> standard date and time format specifier.</returns>
/// <param name="format">A standard date and time format string (see Remarks). </param>
/// <exception cref="T:System.FormatException">
/// <paramref name="format" /> is not a valid standard date and time format specifier character.</exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D6D RID: 15725 RVA: 0x000CEB1C File Offset: 0x000CCD1C
public string[] GetDateTimeFormats(char format)
{
if ("dDgGfFmMrRstTuUyY".IndexOf(format) < 0)
{
throw new FormatException("Invalid format character.");
}
return new string[] { this.ToString(format.ToString()) };
}
/// <summary>Converts the value of this instance to all the string representations supported by the standard date and time format specifiers and the specified culture-specific formatting information.</summary>
/// <returns>A string array where each element is the representation of the value of this instance formatted with one of the standard date and time format specifiers.</returns>
/// <param name="provider">An object that supplies culture-specific formatting information about this instance. </param>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D6E RID: 15726 RVA: 0x000CEB60 File Offset: 0x000CCD60
public string[] GetDateTimeFormats(IFormatProvider provider)
{
DateTimeFormatInfo dateTimeFormatInfo = (DateTimeFormatInfo)provider.GetFormat(typeof(DateTimeFormatInfo));
ArrayList arrayList = new ArrayList();
foreach (char c in "dDgGfFmMrRstTuUyY")
{
arrayList.AddRange(this.GetDateTimeFormats(c, dateTimeFormatInfo));
}
return arrayList.ToArray(typeof(string)) as string[];
}
/// <summary>Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier and culture-specific formatting information.</summary>
/// <returns>A string array where each element is the representation of the value of this instance formatted with one of the standard date and time format specifiers.</returns>
/// <param name="format">A standard date and time format string (see Remarks). </param>
/// <param name="provider">An object that supplies culture-specific formatting information about this instance. </param>
/// <exception cref="T:System.FormatException">
/// <paramref name="format" /> is not a valid standard date and time format specifier character.</exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D6F RID: 15727 RVA: 0x000CEBD8 File Offset: 0x000CCDD8
public string[] GetDateTimeFormats(char format, IFormatProvider provider)
{
if ("dDgGfFmMrRstTuUyY".IndexOf(format) < 0)
{
throw new FormatException("Invalid format character.");
}
bool flag = false;
if (format == 'U')
{
flag = true;
}
DateTimeFormatInfo dateTimeFormatInfo = (DateTimeFormatInfo)provider.GetFormat(typeof(DateTimeFormatInfo));
return this.GetDateTimeFormats(flag, dateTimeFormatInfo.GetAllRawDateTimePatterns(format), dateTimeFormatInfo);
}
// Token: 0x06003D70 RID: 15728 RVA: 0x000CEC40 File Offset: 0x000CCE40
private string[] GetDateTimeFormats(bool adjustutc, string[] patterns, DateTimeFormatInfo dfi)
{
string[] array = new string[patterns.Length];
DateTime dateTime = ((!adjustutc) ? this : this.ToUniversalTime());
for (int i = 0; i < array.Length; i++)
{
array[i] = DateTimeUtils.ToString(dateTime, patterns[i], dfi);
}
return array;
}
// Token: 0x06003D71 RID: 15729 RVA: 0x000CEC90 File Offset: 0x000CCE90
private void CheckDateTimeKind(DateTimeKind kind)
{
if (kind != DateTimeKind.Unspecified && kind != DateTimeKind.Utc && kind != DateTimeKind.Local)
{
throw new ArgumentException("Invalid DateTimeKind value.", "kind");
}
}
/// <summary>Returns the hash code for this instance.</summary>
/// <returns>A 32-bit signed integer hash code.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D72 RID: 15730 RVA: 0x000CECC4 File Offset: 0x000CCEC4
public override int GetHashCode()
{
return (int)this.ticks.Ticks;
}
/// <summary>Returns the <see cref="T:System.TypeCode" /> for value type <see cref="T:System.DateTime" />.</summary>
/// <returns>The enumerated constant, <see cref="F:System.TypeCode.DateTime" />.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D73 RID: 15731 RVA: 0x000CECD4 File Offset: 0x000CCED4
public TypeCode GetTypeCode()
{
return TypeCode.DateTime;
}
/// <summary>Returns an indication whether the specified year is a leap year.</summary>
/// <returns>true if <paramref name="year" /> is a leap year; otherwise, false.</returns>
/// <param name="year">A 4-digit year. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">
/// <paramref name="year" /> is less than 1 or greater than 9999.</exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D74 RID: 15732 RVA: 0x000CECD8 File Offset: 0x000CCED8
public static bool IsLeapYear(int year)
{
if (year < 1 || year > 9999)
{
throw new ArgumentOutOfRangeException();
}
return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;
}
/// <summary>Converts the specified string representation of a date and time to its <see cref="T:System.DateTime" /> equivalent.</summary>
/// <returns>A <see cref="T:System.DateTime" /> equivalent to the date and time contained in <paramref name="s" />.</returns>
/// <param name="s">A string containing a date and time to convert. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="s" /> is null. </exception>
/// <exception cref="T:System.FormatException">
/// <paramref name="s" /> does not contain a valid string representation of a date and time. </exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D75 RID: 15733 RVA: 0x000CED1C File Offset: 0x000CCF1C
public static DateTime Parse(string s)
{
return DateTime.Parse(s, null);
}
/// <summary>Converts the specified string representation of a date and time to its <see cref="T:System.DateTime" /> equivalent using the specified culture-specific format information.</summary>
/// <returns>A <see cref="T:System.DateTime" /> equivalent to the date and time contained in <paramref name="s" /> as specified by <paramref name="provider" />.</returns>
/// <param name="s">A string containing a date and time to convert. </param>
/// <param name="provider">An object that supplies culture-specific format information about <paramref name="s" />. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="s" /> is null. </exception>
/// <exception cref="T:System.FormatException">
/// <paramref name="s" /> does not contain a valid string representation of a date and time. </exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D76 RID: 15734 RVA: 0x000CED28 File Offset: 0x000CCF28
public static DateTime Parse(string s, IFormatProvider provider)
{
return DateTime.Parse(s, provider, DateTimeStyles.AllowWhiteSpaces);
}
/// <summary>Converts the specified string representation of a date and time to its <see cref="T:System.DateTime" /> equivalent using the specified culture-specific format information and formatting style.</summary>
/// <returns>A <see cref="T:System.DateTime" /> equivalent to the date and time contained in <paramref name="s" /> as specified by <paramref name="provider" /> and <paramref name="styles" />.</returns>
/// <param name="s">A string containing a date and time to convert. </param>
/// <param name="provider">An object that supplies culture-specific formatting information about <paramref name="s" />. </param>
/// <param name="styles">A bitwise combination of the enumeration values that indicates the style elements that can be present in <paramref name="s" /> for the parse operation to succeed and that defines how to interpret the parsed date in relation to the current time zone or the current date. A typical value to specify is <see cref="F:System.Globalization.DateTimeStyles.None" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="s" /> is null. </exception>
/// <exception cref="T:System.FormatException">
/// <paramref name="s" /> does not contain a valid string representation of a date and time. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="styles" /> contains an invalid combination of <see cref="T:System.Globalization.DateTimeStyles" /> values. For example, both <see cref="F:System.Globalization.DateTimeStyles.AssumeLocal" /> and <see cref="F:System.Globalization.DateTimeStyles.AssumeUniversal" />.</exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D77 RID: 15735 RVA: 0x000CED34 File Offset: 0x000CCF34
public static DateTime Parse(string s, IFormatProvider provider, DateTimeStyles styles)
{
if (s == null)
{
throw new ArgumentNullException("s");
}
Exception ex = null;
DateTime dateTime;
DateTimeOffset dateTimeOffset;
if (!DateTime.CoreParse(s, provider, styles, out dateTime, out dateTimeOffset, true, ref ex))
{
throw ex;
}
return dateTime;
}
// Token: 0x06003D78 RID: 15736 RVA: 0x000CED6C File Offset: 0x000CCF6C
internal static bool CoreParse(string s, IFormatProvider provider, DateTimeStyles styles, out DateTime result, out DateTimeOffset dto, bool setExceptionOnError, ref Exception exception)
{
dto = new DateTimeOffset(0L, TimeSpan.Zero);
if (s == null || s.Length == 0)
{
if (setExceptionOnError)
{
exception = new FormatException("String was not recognized as a valid DateTime.");
}
result = DateTime.MinValue;
return false;
}
if (provider == null)
{
provider = CultureInfo.CurrentCulture;
}
DateTimeFormatInfo instance = DateTimeFormatInfo.GetInstance(provider);
string[] array = DateTime.YearMonthDayFormats(instance, setExceptionOnError, ref exception);
if (array == null)
{
result = DateTime.MinValue;
return false;
}
bool flag = false;
foreach (string text in array)
{
bool flag2 = false;
if (DateTime._DoParse(s, text, string.Empty, false, out result, out dto, instance, styles, true, ref flag2, ref flag))
{
return true;
}
if (flag2)
{
for (int j = 0; j < DateTime.ParseTimeFormats.Length; j++)
{
if (DateTime._DoParse(s, text, DateTime.ParseTimeFormats[j], false, out result, out dto, instance, styles, true, ref flag2, ref flag))
{
return true;
}
}
}
}
int num = instance.MonthDayPattern.IndexOf('d');
int num2 = instance.MonthDayPattern.IndexOf('M');
if (num == -1 || num2 == -1)
{
result = DateTime.MinValue;
if (setExceptionOnError)
{
exception = new FormatException(Locale.GetText("Order of month and date is not defined by {0}", new object[] { instance.MonthDayPattern }));
}
return false;
}
bool flag3 = num < num2;
string[] array2 = ((!flag3) ? DateTime.MonthDayShortFormats : DateTime.DayMonthShortFormats);
for (int k = 0; k < array2.Length; k++)
{
bool flag4 = false;
if (DateTime._DoParse(s, array2[k], string.Empty, false, out result, out dto, instance, styles, true, ref flag4, ref flag))
{
return true;
}
}
for (int l = 0; l < DateTime.ParseTimeFormats.Length; l++)
{
string text2 = DateTime.ParseTimeFormats[l];
bool flag5 = false;
if (DateTime._DoParse(s, text2, string.Empty, false, out result, out dto, instance, styles, false, ref flag5, ref flag))
{
return true;
}
if (flag5)
{
for (int m = 0; m < array2.Length; m++)
{
if (DateTime._DoParse(s, text2, array2[m], false, out result, out dto, instance, styles, false, ref flag5, ref flag))
{
return true;
}
}
foreach (string text3 in array)
{
if (text3[text3.Length - 1] != 'T')
{
if (DateTime._DoParse(s, text2, text3, false, out result, out dto, instance, styles, false, ref flag5, ref flag))
{
return true;
}
}
}
}
}
if (DateTime.ParseExact(s, instance.GetAllDateTimePatternsInternal(), instance, styles, out result, false, ref flag, setExceptionOnError, ref exception))
{
return true;
}
if (!setExceptionOnError)
{
return false;
}
exception = new FormatException("String was not recognized as a valid DateTime.");
return false;
}
/// <summary>Converts the specified string representation of a date and time to its <see cref="T:System.DateTime" /> equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.</summary>
/// <returns>A <see cref="T:System.DateTime" /> equivalent to the date and time contained in <paramref name="s" /> as specified by <paramref name="format" /> and <paramref name="provider" />.</returns>
/// <param name="s">A string that contains a date and time to convert. </param>
/// <param name="format">A format specifier that defines the required format of <paramref name="s" />. </param>
/// <param name="provider">An object that supplies culture-specific format information about <paramref name="s" />. </param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="s" /> or <paramref name="format" /> is null. </exception>
/// <exception cref="T:System.FormatException">
/// <paramref name="s" /> or <paramref name="format" /> is an empty string. -or- <paramref name="s" /> does not contain a date and time that corresponds to the pattern specified in <paramref name="format" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D79 RID: 15737 RVA: 0x000CF04C File Offset: 0x000CD24C
public static DateTime ParseExact(string s, string format, IFormatProvider provider)
{
return DateTime.ParseExact(s, format, provider, DateTimeStyles.None);
}
// Token: 0x06003D7A RID: 15738 RVA: 0x000CF058 File Offset: 0x000CD258
private static string[] YearMonthDayFormats(DateTimeFormatInfo dfi, bool setExceptionOnError, ref Exception exc)
{
int num = dfi.ShortDatePattern.IndexOf('d');
int num2 = dfi.ShortDatePattern.IndexOf('M');
int num3 = dfi.ShortDatePattern.IndexOf('y');
if (num == -1 || num2 == -1 || num3 == -1)
{
if (setExceptionOnError)
{
exc = new FormatException(Locale.GetText("Order of year, month and date is not defined by {0}", new object[] { dfi.ShortDatePattern }));
}
return null;
}
if (num3 < num2)
{
if (num2 < num)
{
return DateTime.ParseYearMonthDayFormats;
}
if (num3 < num)
{
return DateTime.ParseYearDayMonthFormats;
}
if (setExceptionOnError)
{
exc = new FormatException(Locale.GetText("Order of date, year and month defined by {0} is not supported", new object[] { dfi.ShortDatePattern }));
}
return null;
}
else
{
if (num < num2)
{
return DateTime.ParseDayMonthYearFormats;
}
if (num < num3)
{
return DateTime.ParseMonthDayYearFormats;
}
if (setExceptionOnError)
{
exc = new FormatException(Locale.GetText("Order of month, year and date defined by {0} is not supported", new object[] { dfi.ShortDatePattern }));
}
return null;
}
}
// Token: 0x06003D7B RID: 15739 RVA: 0x000CF158 File Offset: 0x000CD358
private static int _ParseNumber(string s, int valuePos, int min_digits, int digits, bool leadingzero, bool sloppy_parsing, out int num_parsed)
{
int num = 0;
if (sloppy_parsing)
{
leadingzero = false;
}
if (!leadingzero)
{
int num2 = 0;
int i = valuePos;
while (i < s.Length && i < digits + valuePos)
{
if (!char.IsDigit(s[i]))
{
break;
}
num2++;
i++;
}
digits = num2;
}
if (digits < min_digits)
{
num_parsed = -1;
return 0;
}
if (s.Length - valuePos < digits)
{
num_parsed = -1;
return 0;
}
for (int i = valuePos; i < digits + valuePos; i++)
{
char c = s[i];
if (!char.IsDigit(c))
{
num_parsed = -1;
return 0;
}
num = num * 10 + (int)((byte)(c - '0'));
}
num_parsed = digits;
return num;
}
// Token: 0x06003D7C RID: 15740 RVA: 0x000CF218 File Offset: 0x000CD418
private static int _ParseEnum(string s, int sPos, string[] values, string[] invValues, bool exact, out int num_parsed)
{
for (int i = values.Length - 1; i >= 0; i--)
{
if (!exact && invValues[i].Length > values[i].Length)
{
if (invValues[i].Length > 0 && DateTime._ParseString(s, sPos, 0, invValues[i], out num_parsed))
{
return i;
}
if (values[i].Length > 0 && DateTime._ParseString(s, sPos, 0, values[i], out num_parsed))
{
return i;
}
}
else
{
if (values[i].Length > 0 && DateTime._ParseString(s, sPos, 0, values[i], out num_parsed))
{
return i;
}
if (!exact && invValues[i].Length > 0 && DateTime._ParseString(s, sPos, 0, invValues[i], out num_parsed))
{
return i;
}
}
}
num_parsed = -1;
return -1;
}
// Token: 0x06003D7D RID: 15741 RVA: 0x000CF2F0 File Offset: 0x000CD4F0
private static bool _ParseString(string s, int sPos, int maxlength, string value, out int num_parsed)
{
if (maxlength <= 0)
{
maxlength = value.Length;
}
if (sPos + maxlength <= s.Length && string.Compare(s, sPos, value, 0, maxlength, true, CultureInfo.InvariantCulture) == 0)
{
num_parsed = maxlength;
return true;
}
num_parsed = -1;
return false;
}
// Token: 0x06003D7E RID: 15742 RVA: 0x000CF33C File Offset: 0x000CD53C
private static bool _ParseAmPm(string s, int valuePos, int num, DateTimeFormatInfo dfi, bool exact, out int num_parsed, ref int ampm)
{
num_parsed = -1;
if (ampm != -1)
{
return false;
}
if (DateTime.IsLetter(s, valuePos))
{
DateTimeFormatInfo invariantInfo = DateTimeFormatInfo.InvariantInfo;
if ((!exact && DateTime._ParseString(s, valuePos, num, invariantInfo.PMDesignator, out num_parsed)) || (dfi.PMDesignator != string.Empty && DateTime._ParseString(s, valuePos, num, dfi.PMDesignator, out num_parsed)))
{
ampm = 1;
}
else
{
if ((exact || !DateTime._ParseString(s, valuePos, num, invariantInfo.AMDesignator, out num_parsed)) && !DateTime._ParseString(s, valuePos, num, dfi.AMDesignator, out num_parsed))
{
return false;
}
if (exact || num_parsed != 0)
{
ampm = 0;
}
}
return true;
}
if (dfi.AMDesignator != string.Empty)
{
return false;
}
if (exact)
{
ampm = 0;
}
num_parsed = 0;
return true;
}
// Token: 0x06003D7F RID: 15743 RVA: 0x000CF430 File Offset: 0x000CD630
private static bool _ParseTimeSeparator(string s, int sPos, DateTimeFormatInfo dfi, bool exact, out int num_parsed)
{
return DateTime._ParseString(s, sPos, 0, dfi.TimeSeparator, out num_parsed) || (!exact && DateTime._ParseString(s, sPos, 0, ":", out num_parsed));
}
// Token: 0x06003D80 RID: 15744 RVA: 0x000CF470 File Offset: 0x000CD670
private static bool _ParseDateSeparator(string s, int sPos, DateTimeFormatInfo dfi, bool exact, out int num_parsed)
{
num_parsed = -1;
if (exact && s[sPos] != '/')
{
return false;
}
if (DateTime._ParseTimeSeparator(s, sPos, dfi, exact, out num_parsed) || char.IsDigit(s[sPos]) || char.IsLetter(s[sPos]))
{
return false;
}
num_parsed = 1;
return true;
}
// Token: 0x06003D81 RID: 15745 RVA: 0x000CF4D0 File Offset: 0x000CD6D0
private static bool IsLetter(string s, int pos)
{
return pos < s.Length && char.IsLetter(s[pos]);
}
// Token: 0x06003D82 RID: 15746 RVA: 0x000CF4F0 File Offset: 0x000CD6F0
private static bool _DoParse(string s, string firstPart, string secondPart, bool exact, out DateTime result, out DateTimeOffset dto, DateTimeFormatInfo dfi, DateTimeStyles style, bool firstPartIsDate, ref bool incompleteFormat, ref bool longYear)
{
bool flag = false;
bool flag2 = false;
bool flag3 = false;
dto = new DateTimeOffset(0L, TimeSpan.Zero);
bool flag4 = !exact && secondPart != null;
incompleteFormat = false;
int num = 0;
string text = firstPart;
bool flag5 = false;
DateTimeFormatInfo invariantInfo = DateTimeFormatInfo.InvariantInfo;
if (text.Length == 1)
{
text = DateTimeUtils.GetStandardPattern(text[0], dfi, out flag, out flag2);
}
result = new DateTime(0L);
if (text == null)
{
return false;
}
if (s == null)
{
return false;
}
if ((style & DateTimeStyles.AllowLeadingWhite) != DateTimeStyles.None)
{
text = text.TrimStart(null);
s = s.TrimStart(null);
}
if ((style & DateTimeStyles.AllowTrailingWhite) != DateTimeStyles.None)
{
text = text.TrimEnd(null);
s = s.TrimEnd(null);
}
if (flag2)
{
dfi = invariantInfo;
}
if ((style & DateTimeStyles.AllowInnerWhite) != DateTimeStyles.None)
{
flag3 = true;
}
string text2 = text;
int num2 = text.Length;
int num3 = 0;
int num4 = 0;
if (num2 == 0)
{
return false;
}
int num5 = -1;
int num6 = -1;
int num7 = -1;
int num8 = -1;
int num9 = -1;
int num10 = -1;
int num11 = -1;
double num12 = -1.0;
int num13 = -1;
int num14 = -1;
int num15 = -1;
int num16 = -1;
bool flag6 = true;
while (num != s.Length)
{
int num17 = 0;
if (flag4 && num3 + num4 == 0)
{
bool flag7 = DateTime.IsLetter(s, num);
if (flag7)
{
if (s[num] == 'Z')
{
num17 = 1;
}
else
{
DateTime._ParseString(s, num, 0, "GMT", out num17);
}
if (num17 > 0 && !DateTime.IsLetter(s, num + num17))
{
num += num17;
flag = true;
continue;
}
}
if (!flag5 && DateTime._ParseAmPm(s, num, 0, dfi, exact, out num17, ref num13))
{
if (DateTime.IsLetter(s, num + num17))
{
num13 = -1;
}
else if (num17 > 0)
{
num += num17;
continue;
}
}
if (!flag5 && num6 == -1 && flag7)
{
num6 = DateTime._ParseEnum(s, num, dfi.RawDayNames, invariantInfo.RawDayNames, exact, out num17);
if (num6 == -1)
{
num6 = DateTime._ParseEnum(s, num, dfi.RawAbbreviatedDayNames, invariantInfo.RawAbbreviatedDayNames, exact, out num17);
}
if (num6 != -1 && !DateTime.IsLetter(s, num + num17))
{
num += num17;
continue;
}
num6 = -1;
}
if (char.IsWhiteSpace(s[num]) || s[num] == ',')
{
num++;
continue;
}
num17 = 0;
}
if (num3 + num4 >= num2)
{
if (flag4 && num4 == 0)
{
flag5 = flag6 && firstPart[firstPart.Length - 1] == 'T';
if (flag6 || !(text == string.Empty))
{
num3 = 0;
if (flag6)
{
text = secondPart;
}
else
{
text = string.Empty;
}
text2 = text;
num2 = text2.Length;
flag6 = false;
continue;
}
}
IL_EA9:
if (num3 + 1 < num2 && text2[num3] == '.' && text2[num3 + 1] == 'F')
{
num3++;
while (num3 < num2 && text2[num3] == 'F')
{
num3++;
}
}
while (num3 < num2 && text2[num3] == 'K')
{
num3++;
}
if (num3 < num2)
{
return false;
}
if (s.Length > num)
{
if (num == 0)
{
return false;
}
if (char.IsDigit(s[num]) && char.IsDigit(s[num - 1]))
{
return false;
}
if (char.IsLetter(s[num]) && char.IsLetter(s[num - 1]))
{
return false;
}
incompleteFormat = true;
return false;
}
else
{
if (num9 == -1)
{
num9 = 0;
}
if (num10 == -1)
{
num10 = 0;
}
if (num11 == -1)
{
num11 = 0;
}
if (num12 == -1.0)
{
num12 = 0.0;
}
if (num5 == -1 && num7 == -1 && num8 == -1)
{
if ((style & DateTimeStyles.NoCurrentDateDefault) != DateTimeStyles.None)
{
num5 = 1;
num7 = 1;
num8 = 1;
}
else
{
num5 = DateTime.Today.Day;
num7 = DateTime.Today.Month;
num8 = DateTime.Today.Year;
}
}
if (num5 == -1)
{
num5 = 1;
}
if (num7 == -1)
{
num7 = 1;
}
if (num8 == -1)
{
if ((style & DateTimeStyles.NoCurrentDateDefault) != DateTimeStyles.None)
{
num8 = 1;
}
else
{
num8 = DateTime.Today.Year;
}
}
if (num13 == 0 && num9 == 12)
{
num9 = 0;
}
if (num13 == 1 && (!flag4 || num9 < 12))
{
num9 += 12;
}
if (num8 < 1 || num8 > 9999 || num7 < 1 || num7 > 12 || num5 < 1 || num5 > DateTime.DaysInMonth(num8, num7) || num9 < 0 || num9 > 23 || num10 < 0 || num10 > 59 || num11 < 0 || num11 > 59)
{
return false;
}
result = new DateTime(num8, num7, num5, num9, num10, num11, 0);
result = result.AddSeconds(num12);
if (num6 != -1 && num6 != (int)result.DayOfWeek)
{
return false;
}
if (num14 == -1)
{
if (result != DateTime.MinValue)
{
try
{
dto = new DateTimeOffset(result);
}
catch
{
}
}
}
else
{
if (num16 == -1)
{
num16 = 0;
}
if (num15 == -1)
{
num15 = 0;
}
if (num14 == 1)
{
num15 = -num15;
num16 = -num16;
}
try
{
dto = new DateTimeOffset(result, new TimeSpan(num15, num16, 0));
}
catch
{
}
}
bool flag8 = (style & DateTimeStyles.AdjustToUniversal) != DateTimeStyles.None;
if (num14 != -1)
{
long num18 = (result.ticks - dto.Offset).Ticks;
if (num18 < 0L)
{
num18 += 864000000000L;
}
result = new DateTime(false, new TimeSpan(num18));
result.kind = DateTimeKind.Utc;
if ((style & DateTimeStyles.RoundtripKind) != DateTimeStyles.None)
{
result = result.ToLocalTime();
}
}
else if (flag || (style & DateTimeStyles.AssumeUniversal) != DateTimeStyles.None)
{
result.kind = DateTimeKind.Utc;
}
else if ((style & DateTimeStyles.AssumeLocal) != DateTimeStyles.None)
{
result.kind = DateTimeKind.Local;
}
bool flag9 = !flag8 && (style & DateTimeStyles.RoundtripKind) == DateTimeStyles.None;
if (result.kind != DateTimeKind.Unspecified)
{
if (flag8)
{
result = result.ToUniversalTime();
}
else if (flag9)
{
result = result.ToLocalTime();
}
}
return true;
}
}
else
{
bool flag10 = true;
if (text2[num3] == '\'')
{
num4 = 1;
while (num3 + num4 < num2)
{
if (text2[num3 + num4] == '\'')
{
break;
}
if (num == s.Length || s[num] != text2[num3 + num4])
{
return false;
}
num++;
num4++;
}
num3 += num4 + 1;
num4 = 0;
}
else if (text2[num3] == '"')
{
num4 = 1;
while (num3 + num4 < num2)
{
if (text2[num3 + num4] == '"')
{
break;
}
if (num == s.Length || s[num] != text2[num3 + num4])
{
return false;
}
num++;
num4++;
}
num3 += num4 + 1;
num4 = 0;
}
else if (text2[num3] == '\\')
{
num3 += num4 + 1;
num4 = 0;
if (num3 >= num2)
{
return false;
}
if (s[num] != text2[num3])
{
return false;
}
num++;
num3++;
}
else if (text2[num3] == '%')
{
num3++;
}
else if (char.IsWhiteSpace(s[num]) || (s[num] == ',' && ((!exact && text2[num3] == '/') || char.IsWhiteSpace(text2[num3]))))
{
num++;
num4 = 0;
if (exact && (style & DateTimeStyles.AllowInnerWhite) == DateTimeStyles.None)
{
if (!char.IsWhiteSpace(text2[num3]))
{
return false;
}
num3++;
}
else
{
int i;
for (i = num; i < s.Length; i++)
{
if (!char.IsWhiteSpace(s[i]) && s[i] != ',')
{
break;
}
}
num = i;
for (i = num3; i < text2.Length; i++)
{
if (!char.IsWhiteSpace(text2[i]) && text2[i] != ',')
{
break;
}
}
num3 = i;
if (!exact && num3 < text2.Length && text2[num3] == '/' && !DateTime._ParseDateSeparator(s, num, dfi, exact, out num17))
{
num3++;
}
}
}
else if (num3 + num4 + 1 < num2 && text2[num3 + num4 + 1] == text2[num3 + num4])
{
num4++;
}
else
{
char c = text2[num3];
switch (c)
{
case 'F':
flag10 = false;
goto IL_A82;
case 'G':
if (s[num] != 'G')
{
return false;
}
if (num3 + 2 < num2 && num + 2 < s.Length && text2[num3 + 1] == 'M' && s[num + 1] == 'M' && text2[num3 + 2] == 'T' && s[num + 2] == 'T')
{
flag = true;
num4 = 2;
num17 = 3;
}
else
{
num4 = 0;
num17 = 1;
}
break;
case 'H':
if (num9 != -1 || (!flag4 && num13 >= 0))
{
return false;
}
if (num4 == 0)
{
num9 = DateTime._ParseNumber(s, num, 1, 2, false, flag3, out num17);
}
else
{
num9 = DateTime._ParseNumber(s, num, 1, 2, true, flag3, out num17);
}
if (num9 >= 24)
{
return false;
}
break;
default:
switch (c)
{
case 's':
if (num11 != -1)
{
return false;
}
if (num4 == 0)
{
num11 = DateTime._ParseNumber(s, num, 1, 2, false, flag3, out num17);
}
else
{
num11 = DateTime._ParseNumber(s, num, 1, 2, true, flag3, out num17);
}
if (num11 >= 60)
{
return false;
}
break;
case 't':
if (!DateTime._ParseAmPm(s, num, (num4 <= 0) ? 1 : 0, dfi, exact, out num17, ref num13))
{
return false;
}
break;
default:
switch (c)
{
case 'd':
if ((num4 < 2 && num5 != -1) || (num4 >= 2 && num6 != -1))
{
return false;
}
if (num4 == 0)
{
num5 = DateTime._ParseNumber(s, num, 1, 2, false, flag3, out num17);
}
else if (num4 == 1)
{
num5 = DateTime._ParseNumber(s, num, 1, 2, true, flag3, out num17);
}
else if (num4 == 2)
{
num6 = DateTime._ParseEnum(s, num, dfi.RawAbbreviatedDayNames, invariantInfo.RawAbbreviatedDayNames, exact, out num17);
}
else
{
num6 = DateTime._ParseEnum(s, num, dfi.RawDayNames, invariantInfo.RawDayNames, exact, out num17);
}
break;
default:
if (c != '/')
{
if (c != ':')
{
if (c != 'Z')
{
if (c != 'm')
{
if (s[num] != text2[num3])
{
return false;
}
num4 = 0;
num17 = 1;
}
else
{
if (num10 != -1)
{
return false;
}
if (num4 == 0)
{
num10 = DateTime._ParseNumber(s, num, 1, 2, false, flag3, out num17);
}
else
{
num10 = DateTime._ParseNumber(s, num, 1, 2, true, flag3, out num17);
}
if (num10 >= 60)
{
return false;
}
}
}
else
{
if (s[num] != 'Z')
{
return false;
}
num4 = 0;
num17 = 1;
flag = true;
}
}
else if (!DateTime._ParseTimeSeparator(s, num, dfi, exact, out num17))
{
return false;
}
}
else
{
if (!DateTime._ParseDateSeparator(s, num, dfi, exact, out num17))
{
return false;
}
num4 = 0;
}
break;
case 'f':
goto IL_A82;
case 'h':
if (num9 != -1)
{
return false;
}
if (num4 == 0)
{
num9 = DateTime._ParseNumber(s, num, 1, 2, false, flag3, out num17);
}
else
{
num9 = DateTime._ParseNumber(s, num, 1, 2, true, flag3, out num17);
}
if (num9 > 12)
{
return false;
}
if (num9 == 12)
{
num9 = 0;
}
break;
}
break;
case 'y':
if (num8 != -1)
{
return false;
}
if (num4 == 0)
{
num8 = DateTime._ParseNumber(s, num, 1, 2, false, flag3, out num17);
}
else if (num4 < 3)
{
num8 = DateTime._ParseNumber(s, num, 1, 2, true, flag3, out num17);
}
else
{
num8 = DateTime._ParseNumber(s, num, (!exact) ? 3 : 4, 4, false, flag3, out num17);
if (num8 >= 1000 && num17 == 4 && !longYear && s.Length > 4 + num)
{
int num19 = 0;
int num20 = DateTime._ParseNumber(s, num, 5, 5, false, flag3, out num19);
longYear = num20 > 9999;
}
num4 = 3;
}
if (num17 <= 2)
{
num8 += ((num8 >= 30) ? 1900 : 2000);
}
break;
case 'z':
if (num14 != -1)
{
return false;
}
if (s[num] == '+')
{
num14 = 0;
}
else
{
if (s[num] != '-')
{
return false;
}
num14 = 1;
}
num++;
if (num4 == 0)
{
num15 = DateTime._ParseNumber(s, num, 1, 2, false, flag3, out num17);
}
else if (num4 == 1)
{
num15 = DateTime._ParseNumber(s, num, 1, 2, true, flag3, out num17);
}
else
{
num15 = DateTime._ParseNumber(s, num, 1, 2, true, true, out num17);
num += num17;
if (num17 < 0)
{
return false;
}
num17 = 0;
if ((num < s.Length && char.IsDigit(s[num])) || DateTime._ParseTimeSeparator(s, num, dfi, exact, out num17))
{
num += num17;
num16 = DateTime._ParseNumber(s, num, 1, 2, true, flag3, out num17);
if (num17 < 0)
{
return false;
}
}
else
{
if (!flag4)
{
return false;
}
num17 = 0;
}
}
break;
}
break;
case 'K':
if (s[num] == 'Z')
{
num++;
flag = true;
}
else if (s[num] == '+' || s[num] == '-')
{
if (num14 != -1)
{
return false;
}
if (s[num] == '+')
{
num14 = 0;
}
else if (s[num] == '-')
{
num14 = 1;
}
num++;
num15 = DateTime._ParseNumber(s, num, 0, 2, true, flag3, out num17);
num += num17;
if (num17 < 0)
{
return false;
}
if (char.IsDigit(s[num]))
{
num17 = 0;
}
else if (!DateTime._ParseString(s, num, 0, dfi.TimeSeparator, out num17))
{
return false;
}
num += num17;
num16 = DateTime._ParseNumber(s, num, 0, 2, true, flag3, out num17);
num4 = 2;
if (num17 < 0)
{
return false;
}
}
break;
case 'M':
if (num7 != -1)
{
return false;
}
if (flag4)
{
num17 = -1;
if (num4 == 0 || num4 == 3)
{
num7 = DateTime._ParseNumber(s, num, 1, 2, false, flag3, out num17);
}
if (num4 > 1 && num17 == -1)
{
num7 = DateTime._ParseEnum(s, num, dfi.RawMonthNames, invariantInfo.RawMonthNames, exact, out num17) + 1;
}
if (num4 > 1 && num17 == -1)
{
num7 = DateTime._ParseEnum(s, num, dfi.RawAbbreviatedMonthNames, invariantInfo.RawAbbreviatedMonthNames, exact, out num17) + 1;
}
}
else if (num4 == 0)
{
num7 = DateTime._ParseNumber(s, num, 1, 2, false, flag3, out num17);
}
else if (num4 == 1)
{
num7 = DateTime._ParseNumber(s, num, 1, 2, true, flag3, out num17);
}
else if (num4 == 2)
{
num7 = DateTime._ParseEnum(s, num, dfi.RawAbbreviatedMonthNames, invariantInfo.RawAbbreviatedMonthNames, exact, out num17) + 1;
}
else
{
num7 = DateTime._ParseEnum(s, num, dfi.RawMonthNames, invariantInfo.RawMonthNames, exact, out num17) + 1;
}
break;
}
IL_DF3:
if (num17 < 0)
{
return false;
}
num += num17;
if (!exact && !flag4)
{
c = text2[num3];
if (c == 'F' || c == 'f' || c == 'm' || c == 's' || c == 'z')
{
if (s.Length > num && s[num] == 'Z' && (num3 + 1 == text2.Length || text2[num3 + 1] != 'Z'))
{
flag = true;
num++;
}
}
}
num3 = num3 + num4 + 1;
num4 = 0;
continue;
IL_A82:
if (num4 > 6 || num12 != -1.0)
{
return false;
}
double num21 = (double)DateTime._ParseNumber(s, num, 0, num4 + 1, flag10, flag3, out num17);
if (num17 == -1)
{
return false;
}
num12 = num21 / Math.Pow(10.0, (double)num17);
goto IL_DF3;
}
}
}
goto IL_EA9;
}
/// <summary>Converts the specified string representation of a date and time to its <see cref="T:System.DateTime" /> equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly or an exception is thrown.</summary>
/// <returns>A <see cref="T:System.DateTime" /> equivalent to the date and time contained in <paramref name="s" /> as specified by <paramref name="format" />, <paramref name="provider" />, and <paramref name="style" />.</returns>
/// <param name="s">A string containing a date and time to convert. </param>
/// <param name="format">A format specifier that defines the required format of <paramref name="s" />. </param>
/// <param name="provider">An object that supplies culture-specific formatting information about <paramref name="s" />. </param>
/// <param name="style">A bitwise combination of the enumeration values that provides additional information about <paramref name="s" />, about style elements that may be present in <paramref name="s" />, or about the conversion from <paramref name="s" /> to a <see cref="T:System.DateTime" /> value. A typical value to specify is <see cref="F:System.Globalization.DateTimeStyles.None" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="s" /> or <paramref name="format" /> is null. </exception>
/// <exception cref="T:System.FormatException">
/// <paramref name="s" /> or <paramref name="format" /> is an empty string. -or- <paramref name="s" /> does not contain a date and time that corresponds to the pattern specified in <paramref name="format" />. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="style" /> contains an invalid combination of <see cref="T:System.Globalization.DateTimeStyles" /> values. For example, both <see cref="F:System.Globalization.DateTimeStyles.AssumeLocal" /> and <see cref="F:System.Globalization.DateTimeStyles.AssumeUniversal" />.</exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D83 RID: 15747 RVA: 0x000D0810 File Offset: 0x000CEA10
public static DateTime ParseExact(string s, string format, IFormatProvider provider, DateTimeStyles style)
{
if (format == null)
{
throw new ArgumentNullException("format");
}
return DateTime.ParseExact(s, new string[] { format }, provider, style);
}
/// <summary>Converts the specified string representation of a date and time to its <see cref="T:System.DateTime" /> equivalent using the specified array of formats, culture-specific format information, and style. The format of the string representation must match at least one of the specified formats exactly or an exception is thrown.</summary>
/// <returns>A <see cref="T:System.DateTime" /> equivalent to the date and time contained in <paramref name="s" /> as specified by <paramref name="formats" />, <paramref name="provider" />, and <paramref name="style" />.</returns>
/// <param name="s">A string containing one or more dates and times to convert. </param>
/// <param name="formats">An array of allowable formats of <paramref name="s" />. </param>
/// <param name="provider">An <see cref="T:System.IFormatProvider" /> that supplies culture-specific format information about <paramref name="s" />. </param>
/// <param name="style">A bitwise combination of <see cref="T:System.Globalization.DateTimeStyles" /> values that indicates the permitted format of <paramref name="s" />. A typical value to specify is <see cref="F:System.Globalization.DateTimeStyles.None" />.</param>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="s" /> or <paramref name="formats" /> is null. </exception>
/// <exception cref="T:System.FormatException">
/// <paramref name="s" /> is an empty string. -or- an element of <paramref name="formats" /> is an empty string. -or- <paramref name="s" /> does not contain a date and time that corresponds to any element of <paramref name="formats" />. </exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="style" /> contains an invalid combination of <see cref="T:System.Globalization.DateTimeStyles" /> values. For example, both <see cref="F:System.Globalization.DateTimeStyles.AssumeLocal" /> and <see cref="F:System.Globalization.DateTimeStyles.AssumeUniversal" />.</exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D84 RID: 15748 RVA: 0x000D0844 File Offset: 0x000CEA44
public static DateTime ParseExact(string s, string[] formats, IFormatProvider provider, DateTimeStyles style)
{
DateTimeFormatInfo instance = DateTimeFormatInfo.GetInstance(provider);
DateTime.CheckStyle(style);
if (s == null)
{
throw new ArgumentNullException("s");
}
if (formats == null)
{
throw new ArgumentNullException("formats");
}
if (formats.Length == 0)
{
throw new FormatException("Format specifier was invalid.");
}
bool flag = false;
Exception ex = null;
DateTime dateTime;
if (!DateTime.ParseExact(s, formats, instance, style, out dateTime, true, ref flag, true, ref ex))
{
throw ex;
}
return dateTime;
}
// Token: 0x06003D85 RID: 15749 RVA: 0x000D08B0 File Offset: 0x000CEAB0
private static void CheckStyle(DateTimeStyles style)
{
if ((style & DateTimeStyles.RoundtripKind) != DateTimeStyles.None && ((style & DateTimeStyles.AdjustToUniversal) != DateTimeStyles.None || (style & DateTimeStyles.AssumeLocal) != DateTimeStyles.None || (style & DateTimeStyles.AssumeUniversal) != DateTimeStyles.None))
{
throw new ArgumentException("The DateTimeStyles value RoundtripKind cannot be used with the values AssumeLocal, Asersal or AdjustToUniversal.", "style");
}
if ((style & DateTimeStyles.AssumeUniversal) != DateTimeStyles.None && (style & DateTimeStyles.AssumeLocal) != DateTimeStyles.None)
{
throw new ArgumentException("The DateTimeStyles values AssumeLocal and AssumeUniversal cannot be used together.", "style");
}
}
/// <summary>Converts the specified string representation of a date and time to its <see cref="T:System.DateTime" /> equivalent and returns a value that indicates whether the conversion succeeded.</summary>
/// <returns>true if the <paramref name="s" /> parameter was converted successfully; otherwise, false.</returns>
/// <param name="s">A string containing a date and time to convert. </param>
/// <param name="result">When this method returns, contains the <see cref="T:System.DateTime" /> value equivalent to the date and time contained in <paramref name="s" />, if the conversion succeeded, or <see cref="F:System.DateTime.MinValue" /> if the conversion failed. The conversion fails if the <paramref name="s" /> parameter is null, is an empty string (""), or does not contain a valid string representation of a date and time. This parameter is passed uninitialized. </param>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D86 RID: 15750 RVA: 0x000D0918 File Offset: 0x000CEB18
public static bool TryParse(string s, out DateTime result)
{
if (s != null)
{
try
{
Exception ex = null;
DateTimeOffset dateTimeOffset;
return DateTime.CoreParse(s, null, DateTimeStyles.AllowWhiteSpaces, out result, out dateTimeOffset, false, ref ex);
}
catch
{
}
}
result = DateTime.MinValue;
return false;
}
/// <summary>Converts the specified string representation of a date and time to its <see cref="T:System.DateTime" /> equivalent using the specified culture-specific format information and formatting style, and returns a value that indicates whether the conversion succeeded.</summary>
/// <returns>true if the <paramref name="s" /> parameter was converted successfully; otherwise, false.</returns>
/// <param name="s">A string containing a date and time to convert. </param>
/// <param name="provider">An object that supplies culture-specific formatting information about <paramref name="s" />. </param>
/// <param name="styles">A bitwise combination of enumeration values that defines how to interpret the parsed date in relation to the current time zone or the current date. A typical value to specify is <see cref="F:System.Globalization.DateTimeStyles.None" />.</param>
/// <param name="result">When this method returns, contains the <see cref="T:System.DateTime" /> value equivalent to the date and time contained in <paramref name="s" />, if the conversion succeeded, or <see cref="F:System.DateTime.MinValue" /> if the conversion failed. The conversion fails if the <paramref name="s" /> parameter is null, is an empty string (""), or does not contain a valid string representation of a date and time. This parameter is passed uninitialized. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="styles" /> is not a valid <see cref="T:System.Globalization.DateTimeStyles" /> value.-or-<paramref name="styles" /> contains an invalid combination of <see cref="T:System.Globalization.DateTimeStyles" /> values (for example, both <see cref="F:System.Globalization.DateTimeStyles.AssumeLocal" /> and <see cref="F:System.Globalization.DateTimeStyles.AssumeUniversal" />).</exception>
/// <exception cref="T:System.NotSupportedException">
/// <paramref name="provider" /> is a neutral culture and cannot be used in a parsing operation.</exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D87 RID: 15751 RVA: 0x000D0978 File Offset: 0x000CEB78
public static bool TryParse(string s, IFormatProvider provider, DateTimeStyles styles, out DateTime result)
{
if (s != null)
{
try
{
Exception ex = null;
DateTimeOffset dateTimeOffset;
return DateTime.CoreParse(s, provider, styles, out result, out dateTimeOffset, false, ref ex);
}
catch
{
}
}
result = DateTime.MinValue;
return false;
}
/// <summary>Converts the specified string representation of a date and time to its <see cref="T:System.DateTime" /> equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly. The method returns a value that indicates whether the conversion succeeded.</summary>
/// <returns>true if <paramref name="s" /> was converted successfully; otherwise, false.</returns>
/// <param name="s">A string containing a date and time to convert. </param>
/// <param name="format">The required format of <paramref name="s" />. </param>
/// <param name="provider">An <see cref="T:System.IFormatProvider" /> object that supplies culture-specific formatting information about <paramref name="s" />. </param>
/// <param name="style">A bitwise combination of one or more enumeration values that indicate the permitted format of <paramref name="s" />. </param>
/// <param name="result">When this method returns, contains the <see cref="T:System.DateTime" /> value equivalent to the date and time contained in <paramref name="s" />, if the conversion succeeded, or <see cref="F:System.DateTime.MinValue" /> if the conversion failed. The conversion fails if either the <paramref name="s" /> or <paramref name="format" /> parameter is null, is an empty string, or does not contain a date and time that correspond to the pattern specified in <paramref name="format" />. This parameter is passed uninitialized. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="styles" /> is not a valid <see cref="T:System.Globalization.DateTimeStyles" /> value.-or-<paramref name="styles" /> contains an invalid combination of <see cref="T:System.Globalization.DateTimeStyles" /> values (for example, both <see cref="F:System.Globalization.DateTimeStyles.AssumeLocal" /> and <see cref="F:System.Globalization.DateTimeStyles.AssumeUniversal" />).</exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D88 RID: 15752 RVA: 0x000D09D8 File Offset: 0x000CEBD8
public static bool TryParseExact(string s, string format, IFormatProvider provider, DateTimeStyles style, out DateTime result)
{
return DateTime.TryParseExact(s, new string[] { format }, provider, style, out result);
}
/// <summary>Converts the specified string representation of a date and time to its <see cref="T:System.DateTime" /> equivalent using the specified array of formats, culture-specific format information, and style. The format of the string representation must match at least one of the specified formats exactly. The method returns a value that indicates whether the conversion succeeded.</summary>
/// <returns>true if the <paramref name="s" /> parameter was converted successfully; otherwise, false.</returns>
/// <param name="s">A string containing one or more dates and times to convert. </param>
/// <param name="formats">An array of allowable formats of <paramref name="s" />. </param>
/// <param name="provider">An object that supplies culture-specific format information about <paramref name="s" />. </param>
/// <param name="style">A bitwise combination of enumeration values that indicates the permitted format of <paramref name="s" />. A typical value to specify is <see cref="F:System.Globalization.DateTimeStyles.None" />.</param>
/// <param name="result">When this method returns, contains the <see cref="T:System.DateTime" /> value equivalent to the date and time contained in <paramref name="s" />, if the conversion succeeded, or <see cref="F:System.DateTime.MinValue" /> if the conversion failed. The conversion fails if <paramref name="s" /> or <paramref name="formats" /> is null, <paramref name="s" /> or an element of <paramref name="formats" /> is an empty string, or the format of <paramref name="s" /> is not exactly as specified by at least one of the format patterns in <paramref name="formats" />. This parameter is passed uninitialized. </param>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="styles" /> is not a valid <see cref="T:System.Globalization.DateTimeStyles" /> value.-or-<paramref name="styles" /> contains an invalid combination of <see cref="T:System.Globalization.DateTimeStyles" /> values (for example, both <see cref="F:System.Globalization.DateTimeStyles.AssumeLocal" /> and <see cref="F:System.Globalization.DateTimeStyles.AssumeUniversal" />).</exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D89 RID: 15753 RVA: 0x000D09FC File Offset: 0x000CEBFC
public static bool TryParseExact(string s, string[] formats, IFormatProvider provider, DateTimeStyles style, out DateTime result)
{
bool flag2;
try
{
DateTimeFormatInfo instance = DateTimeFormatInfo.GetInstance(provider);
bool flag = false;
Exception ex = null;
flag2 = DateTime.ParseExact(s, formats, instance, style, out result, true, ref flag, false, ref ex);
}
catch
{
result = DateTime.MinValue;
flag2 = false;
}
return flag2;
}
// Token: 0x06003D8A RID: 15754 RVA: 0x000D0A68 File Offset: 0x000CEC68
private static bool ParseExact(string s, string[] formats, DateTimeFormatInfo dfi, DateTimeStyles style, out DateTime ret, bool exact, ref bool longYear, bool setExceptionOnError, ref Exception exception)
{
bool flag = false;
for (int i = 0; i < formats.Length; i++)
{
string text = formats[i];
if (text == null || text == string.Empty)
{
break;
}
DateTime dateTime;
DateTimeOffset dateTimeOffset;
if (DateTime._DoParse(s, formats[i], null, exact, out dateTime, out dateTimeOffset, dfi, style, false, ref flag, ref longYear))
{
ret = dateTime;
return true;
}
}
if (setExceptionOnError)
{
exception = new FormatException("Invalid format string");
}
ret = DateTime.MinValue;
return false;
}
/// <summary>Subtracts the specified date and time from this instance.</summary>
/// <returns>A <see cref="T:System.TimeSpan" /> interval equal to the date and time represented by this instance minus the date and time represented by <paramref name="value" />.</returns>
/// <param name="value">An instance of <see cref="T:System.DateTime" />. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The result is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D8B RID: 15755 RVA: 0x000D0AF4 File Offset: 0x000CECF4
public TimeSpan Subtract(DateTime value)
{
return new TimeSpan(this.ticks.Ticks) - value.ticks;
}
/// <summary>Subtracts the specified duration from this instance.</summary>
/// <returns>A <see cref="T:System.DateTime" /> equal to the date and time represented by this instance minus the time interval represented by <paramref name="value" />.</returns>
/// <param name="value">An instance of <see cref="T:System.TimeSpan" />. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The result is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D8C RID: 15756 RVA: 0x000D0B14 File Offset: 0x000CED14
public DateTime Subtract(TimeSpan value)
{
TimeSpan timeSpan = new TimeSpan(this.ticks.Ticks) - value;
return new DateTime(true, timeSpan)
{
kind = this.kind
};
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to a Windows file time.</summary>
/// <returns>The value of the current <see cref="T:System.DateTime" /> object expressed as a Windows file time.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting file time would represent a date and time before 12:00 midnight January 1, 1601 C.E. UTC. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D8D RID: 15757 RVA: 0x000D0B50 File Offset: 0x000CED50
public long ToFileTime()
{
DateTime dateTime = this.ToUniversalTime();
if (dateTime.Ticks < 504911232000000000L)
{
throw new ArgumentOutOfRangeException("file time is not valid");
}
return dateTime.Ticks - 504911232000000000L;
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to a Windows file time.</summary>
/// <returns>The value of the current <see cref="T:System.DateTime" /> object expressed as a Windows file time.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting file time would represent a date and time before 12:00 midnight January 1, 1601 C.E. UTC. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D8E RID: 15758 RVA: 0x000D0B98 File Offset: 0x000CED98
public long ToFileTimeUtc()
{
if (this.Ticks < 504911232000000000L)
{
throw new ArgumentOutOfRangeException("file time is not valid");
}
return this.Ticks - 504911232000000000L;
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to its equivalent long date string representation.</summary>
/// <returns>A string that contains the long date string representation of the current <see cref="T:System.DateTime" /> object.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D8F RID: 15759 RVA: 0x000D0BCC File Offset: 0x000CEDCC
public string ToLongDateString()
{
return this.ToString("D");
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to its equivalent long time string representation.</summary>
/// <returns>A string that contains the long time string representation of the current <see cref="T:System.DateTime" /> object.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D90 RID: 15760 RVA: 0x000D0BDC File Offset: 0x000CEDDC
public string ToLongTimeString()
{
return this.ToString("T");
}
/// <summary>Converts the value of this instance to the equivalent OLE Automation date.</summary>
/// <returns>A double-precision floating-point number that contains an OLE Automation date equivalent to the value of this instance.</returns>
/// <exception cref="T:System.OverflowException">The value of this instance cannot be represented as an OLE Automation date. </exception>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D91 RID: 15761 RVA: 0x000D0BEC File Offset: 0x000CEDEC
public double ToOADate()
{
long num = this.Ticks;
if (num == 0L)
{
return 0.0;
}
if (num < 31242239136000000L)
{
return -657434.999;
}
TimeSpan timeSpan = new TimeSpan(this.Ticks - 599264352000000000L);
double num2 = timeSpan.TotalDays;
if (num < 599264352000000000L)
{
double num3 = Math.Ceiling(num2);
num2 = num3 - 2.0 - (num2 - num3);
}
else if (num2 >= 2958466.0)
{
num2 = 2958465.99999999;
}
return num2;
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to its equivalent short date string representation.</summary>
/// <returns>A string that contains the short date string representation of the current <see cref="T:System.DateTime" /> object.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D92 RID: 15762 RVA: 0x000D0C90 File Offset: 0x000CEE90
public string ToShortDateString()
{
return this.ToString("d");
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to its equivalent short time string representation.</summary>
/// <returns>A string that contains the short time string representation of the current <see cref="T:System.DateTime" /> object.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D93 RID: 15763 RVA: 0x000D0CA0 File Offset: 0x000CEEA0
public string ToShortTimeString()
{
return this.ToString("t");
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to its equivalent string representation.</summary>
/// <returns>A string representation of the value of the current <see cref="T:System.DateTime" /> object.</returns>
/// <exception cref="T:System.ArgumentOutOfRangeException">The date and time is outside the range of dates supported by the calendar used by the current culture. </exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D94 RID: 15764 RVA: 0x000D0CB0 File Offset: 0x000CEEB0
public override string ToString()
{
return this.ToString("G", null);
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to its equivalent string representation using the specified culture-specific format information.</summary>
/// <returns>A string representation of value of the current <see cref="T:System.DateTime" /> object as specified by <paramref name="provider" />.</returns>
/// <param name="provider">An object that supplies culture-specific formatting information. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The date and time is outside the range of dates supported by the calendar used by <paramref name="provider" />. </exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D95 RID: 15765 RVA: 0x000D0CC0 File Offset: 0x000CEEC0
public string ToString(IFormatProvider provider)
{
return this.ToString(null, provider);
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to its equivalent string representation using the specified format.</summary>
/// <returns>A string representation of value of the current <see cref="T:System.DateTime" /> object as specified by <paramref name="format" />.</returns>
/// <param name="format">A standard or custom date and time format string. </param>
/// <exception cref="T:System.FormatException">The length of <paramref name="format" /> is 1, and it is not one of the format specifier characters defined for <see cref="T:System.Globalization.DateTimeFormatInfo" />.-or- <paramref name="format" /> does not contain a valid custom format pattern. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The date and time is outside the range of dates supported by the calendar used by the current culture.</exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D96 RID: 15766 RVA: 0x000D0CCC File Offset: 0x000CEECC
public string ToString(string format)
{
return this.ToString(format, null);
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to its equivalent string representation using the specified format and culture-specific format information.</summary>
/// <returns>A string representation of value of the current <see cref="T:System.DateTime" /> object as specified by <paramref name="format" /> and <paramref name="provider" />.</returns>
/// <param name="format">A standard or custom date and time format string. </param>
/// <param name="provider">An object that supplies culture-specific formatting information. </param>
/// <exception cref="T:System.FormatException">The length of <paramref name="format" /> is 1, and it is not one of the format specifier characters defined for <see cref="T:System.Globalization.DateTimeFormatInfo" />.-or- <paramref name="format" /> does not contain a valid custom format pattern. </exception>
/// <exception cref="T:System.ArgumentOutOfRangeException">The date and time is outside the range of dates supported by the calendar used by <paramref name="provider" />. </exception>
/// <filterpriority>1</filterpriority>
// Token: 0x06003D97 RID: 15767 RVA: 0x000D0CD8 File Offset: 0x000CEED8
public string ToString(string format, IFormatProvider provider)
{
DateTimeFormatInfo instance = DateTimeFormatInfo.GetInstance(provider);
if (format == null || format == string.Empty)
{
format = "G";
}
bool flag = false;
bool flag2 = false;
if (format.Length == 1)
{
char c = format[0];
format = DateTimeUtils.GetStandardPattern(c, instance, out flag, out flag2);
if (c == 'U')
{
return DateTimeUtils.ToString(this.ToUniversalTime(), format, instance);
}
if (format == null)
{
throw new FormatException("format is not one of the format specifier characters defined for DateTimeFormatInfo");
}
}
return DateTimeUtils.ToString(this, format, instance);
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to local time.</summary>
/// <returns>A <see cref="T:System.DateTime" /> object whose <see cref="P:System.DateTime.Kind" /> property is <see cref="F:System.DateTimeKind.Local" />, and whose value is the local time equivalent to the value of the current <see cref="T:System.DateTime" /> object, or <see cref="F:System.DateTime.MaxValue" /> if the converted value is too large to be represented by a <see cref="T:System.DateTime" /> object, or <see cref="F:System.DateTime.MinValue" /> if the converted value is too small to be represented as a <see cref="T:System.DateTime" /> object.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D98 RID: 15768 RVA: 0x000D0D64 File Offset: 0x000CEF64
public DateTime ToLocalTime()
{
return TimeZone.CurrentTimeZone.ToLocalTime(this);
}
/// <summary>Converts the value of the current <see cref="T:System.DateTime" /> object to Coordinated Universal Time (UTC).</summary>
/// <returns>A <see cref="T:System.DateTime" /> object whose <see cref="P:System.DateTime.Kind" /> property is <see cref="F:System.DateTimeKind.Utc" />, and whose value is the UTC equivalent to the value of the current <see cref="T:System.DateTime" /> object, or <see cref="F:System.DateTime.MaxValue" /> if the converted value is too large to be represented by a <see cref="T:System.DateTime" /> object, or <see cref="F:System.DateTime.MinValue" /> if the converted value is too small to be represented by a <see cref="T:System.DateTime" /> object.</returns>
/// <filterpriority>2</filterpriority>
// Token: 0x06003D99 RID: 15769 RVA: 0x000D0D78 File Offset: 0x000CEF78
public DateTime ToUniversalTime()
{
return TimeZone.CurrentTimeZone.ToUniversalTime(this);
}
/// <summary>Adds a specified time interval to a specified date and time, yielding a new date and time.</summary>
/// <returns>A <see cref="T:System.DateTime" /> that is the sum of the values of <paramref name="d" /> and <paramref name="t" />.</returns>
/// <param name="d">A <see cref="T:System.DateTime" />. </param>
/// <param name="t">A <see cref="T:System.TimeSpan" />. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>3</filterpriority>
// Token: 0x06003D9A RID: 15770 RVA: 0x000D0D8C File Offset: 0x000CEF8C
public static DateTime operator +(DateTime d, TimeSpan t)
{
return new DateTime(true, d.ticks + t)
{
kind = d.kind
};
}
/// <summary>Determines whether two specified instances of <see cref="T:System.DateTime" /> are equal.</summary>
/// <returns>true if <paramref name="d1" /> and <paramref name="d2" /> represent the same date and time; otherwise, false.</returns>
/// <param name="d1">A <see cref="T:System.DateTime" />. </param>
/// <param name="d2">A <see cref="T:System.DateTime" />. </param>
/// <filterpriority>3</filterpriority>
// Token: 0x06003D9B RID: 15771 RVA: 0x000D0DC0 File Offset: 0x000CEFC0
public static bool operator ==(DateTime d1, DateTime d2)
{
return d1.ticks == d2.ticks;
}
/// <summary>Determines whether one specified <see cref="T:System.DateTime" /> is greater than another specified <see cref="T:System.DateTime" />.</summary>
/// <returns>true if <paramref name="t1" /> is greater than <paramref name="t2" />; otherwise, false.</returns>
/// <param name="t1">A <see cref="T:System.DateTime" />. </param>
/// <param name="t2">A <see cref="T:System.DateTime" />. </param>
/// <filterpriority>3</filterpriority>
// Token: 0x06003D9C RID: 15772 RVA: 0x000D0DD8 File Offset: 0x000CEFD8
public static bool operator >(DateTime t1, DateTime t2)
{
return t1.ticks > t2.ticks;
}
/// <summary>Determines whether one specified <see cref="T:System.DateTime" /> is greater than or equal to another specified <see cref="T:System.DateTime" />.</summary>
/// <returns>true if <paramref name="t1" /> is greater than or equal to <paramref name="t2" />; otherwise, false.</returns>
/// <param name="t1">A <see cref="T:System.DateTime" />. </param>
/// <param name="t2">A <see cref="T:System.DateTime" />. </param>
/// <filterpriority>3</filterpriority>
// Token: 0x06003D9D RID: 15773 RVA: 0x000D0DF0 File Offset: 0x000CEFF0
public static bool operator >=(DateTime t1, DateTime t2)
{
return t1.ticks >= t2.ticks;
}
/// <summary>Determines whether two specified instances of <see cref="T:System.DateTime" /> are not equal.</summary>
/// <returns>true if <paramref name="d1" /> and <paramref name="d2" /> do not represent the same date and time; otherwise, false.</returns>
/// <param name="d1">A <see cref="T:System.DateTime" />. </param>
/// <param name="d2">A <see cref="T:System.DateTime" />. </param>
/// <filterpriority>3</filterpriority>
// Token: 0x06003D9E RID: 15774 RVA: 0x000D0E08 File Offset: 0x000CF008
public static bool operator !=(DateTime d1, DateTime d2)
{
return d1.ticks != d2.ticks;
}
/// <summary>Determines whether one specified <see cref="T:System.DateTime" /> is less than another specified <see cref="T:System.DateTime" />.</summary>
/// <returns>true if <paramref name="t1" /> is less than <paramref name="t2" />; otherwise, false.</returns>
/// <param name="t1">A <see cref="T:System.DateTime" />. </param>
/// <param name="t2">A <see cref="T:System.DateTime" />. </param>
/// <filterpriority>3</filterpriority>
// Token: 0x06003D9F RID: 15775 RVA: 0x000D0E20 File Offset: 0x000CF020
public static bool operator <(DateTime t1, DateTime t2)
{
return t1.ticks < t2.ticks;
}
/// <summary>Determines whether one specified <see cref="T:System.DateTime" /> is less than or equal to another specified <see cref="T:System.DateTime" />.</summary>
/// <returns>true if <paramref name="t1" /> is less than or equal to <paramref name="t2" />; otherwise, false.</returns>
/// <param name="t1">A <see cref="T:System.DateTime" />. </param>
/// <param name="t2">A <see cref="T:System.DateTime" />. </param>
/// <filterpriority>3</filterpriority>
// Token: 0x06003DA0 RID: 15776 RVA: 0x000D0E38 File Offset: 0x000CF038
public static bool operator <=(DateTime t1, DateTime t2)
{
return t1.ticks <= t2.ticks;
}
/// <summary>Subtracts a specified date and time from another specified date and time and returns a time interval.</summary>
/// <returns>A <see cref="T:System.TimeSpan" /> that is the time interval between <paramref name="d1" /> and <paramref name="d2" />; that is, <paramref name="d1" /> minus <paramref name="d2" />.</returns>
/// <param name="d1">A <see cref="T:System.DateTime" /> (the minuend). </param>
/// <param name="d2">A <see cref="T:System.DateTime" /> (the subtrahend). </param>
/// <filterpriority>3</filterpriority>
// Token: 0x06003DA1 RID: 15777 RVA: 0x000D0E50 File Offset: 0x000CF050
public static TimeSpan operator -(DateTime d1, DateTime d2)
{
return new TimeSpan((d1.ticks - d2.ticks).Ticks);
}
/// <summary>Subtracts a specified time interval from a specified date and time and returns a new date and time.</summary>
/// <returns>A <see cref="T:System.DateTime" /> whose value is the value of <paramref name="d" /> minus the value of <paramref name="t" />.</returns>
/// <param name="d">A <see cref="T:System.DateTime" />. </param>
/// <param name="t">A <see cref="T:System.TimeSpan" />. </param>
/// <exception cref="T:System.ArgumentOutOfRangeException">The resulting <see cref="T:System.DateTime" /> is less than <see cref="F:System.DateTime.MinValue" /> or greater than <see cref="F:System.DateTime.MaxValue" />. </exception>
/// <filterpriority>3</filterpriority>
// Token: 0x06003DA2 RID: 15778 RVA: 0x000D0E80 File Offset: 0x000CF080
public static DateTime operator -(DateTime d, TimeSpan t)
{
return new DateTime(true, d.ticks - t)
{
kind = d.kind
};
}
// Token: 0x04001894 RID: 6292
private const int dp400 = 146097;
// Token: 0x04001895 RID: 6293
private const int dp100 = 36524;
// Token: 0x04001896 RID: 6294
private const int dp4 = 1461;
// Token: 0x04001897 RID: 6295
private const long w32file_epoch = 504911232000000000L;
// Token: 0x04001898 RID: 6296
private const long MAX_VALUE_TICKS = 3155378975999999999L;
// Token: 0x04001899 RID: 6297
internal const long UnixEpoch = 621355968000000000L;
// Token: 0x0400189A RID: 6298
private const long ticks18991230 = 599264352000000000L;
// Token: 0x0400189B RID: 6299
private const double OAMinValue = -657435.0;
// Token: 0x0400189C RID: 6300
private const double OAMaxValue = 2958466.0;
// Token: 0x0400189D RID: 6301
private const string formatExceptionMessage = "String was not recognized as a valid DateTime.";
// Token: 0x0400189E RID: 6302
private TimeSpan ticks;
// Token: 0x0400189F RID: 6303
private DateTimeKind kind;
/// <summary>Represents the largest possible value of <see cref="T:System.DateTime" />. This field is read-only.</summary>
/// <filterpriority>1</filterpriority>
// Token: 0x040018A0 RID: 6304
public static readonly DateTime MaxValue = new DateTime(false, new TimeSpan(3155378975999999999L));
/// <summary>Represents the smallest possible value of <see cref="T:System.DateTime" />. This field is read-only.</summary>
/// <filterpriority>1</filterpriority>
// Token: 0x040018A1 RID: 6305
public static readonly DateTime MinValue = new DateTime(false, new TimeSpan(0L));
// Token: 0x040018A2 RID: 6306
private static readonly string[] ParseTimeFormats = new string[] { "H:m:s.fffffffzzz", "H:m:s.fffffff", "H:m:s tt zzz", "H:m:szzz", "H:m:s", "H:mzzz", "H:m", "H tt", "H'時'm'分's'秒'" };
// Token: 0x040018A3 RID: 6307
private static readonly string[] ParseYearDayMonthFormats = new string[] { "yyyy/M/dT", "M/yyyy/dT", "yyyy'年'M'月'd'日", "yyyy/d/MMMM", "yyyy/MMM/d", "d/MMMM/yyyy", "MMM/d/yyyy", "d/yyyy/MMMM", "MMM/yyyy/d", "yy/d/M" };
// Token: 0x040018A4 RID: 6308
private static readonly string[] ParseYearMonthDayFormats = new string[]
{
"yyyy/M/dT", "M/yyyy/dT", "yyyy'年'M'月'd'日", "yyyy/MMMM/d", "yyyy/d/MMM", "MMMM/d/yyyy", "d/MMM/yyyy", "MMMM/yyyy/d", "d/yyyy/MMM", "yy/MMMM/d",
"yy/d/MMM", "MMM/yy/d"
};
// Token: 0x040018A5 RID: 6309
private static readonly string[] ParseDayMonthYearFormats = new string[]
{
"yyyy/M/dT", "M/yyyy/dT", "yyyy'年'M'月'd'日", "yyyy/MMMM/d", "yyyy/d/MMM", "d/MMMM/yyyy", "MMM/d/yyyy", "MMMM/yyyy/d", "d/yyyy/MMM", "d/MMMM/yy",
"yy/MMM/d", "d/yy/MMM", "yy/d/MMM", "MMM/d/yy", "MMM/yy/d"
};
// Token: 0x040018A6 RID: 6310
private static readonly string[] ParseMonthDayYearFormats = new string[]
{
"yyyy/M/dT", "M/yyyy/dT", "yyyy'年'M'月'd'日", "yyyy/MMMM/d", "yyyy/d/MMM", "MMMM/d/yyyy", "d/MMM/yyyy", "MMMM/yyyy/d", "d/yyyy/MMM", "MMMM/d/yy",
"MMM/yy/d", "d/MMM/yy", "yy/MMM/d", "d/yy/MMM", "yy/d/MMM"
};
// Token: 0x040018A7 RID: 6311
private static readonly string[] MonthDayShortFormats = new string[] { "MMMM/d", "d/MMM", "yyyy/MMMM" };
// Token: 0x040018A8 RID: 6312
private static readonly string[] DayMonthShortFormats = new string[] { "d/MMMM", "MMM/yy", "yyyy/MMMM" };
// Token: 0x040018A9 RID: 6313
private static readonly int[] daysmonth = new int[]
{
0, 31, 28, 31, 30, 31, 30, 31, 31, 30,
31, 30, 31
};
// Token: 0x040018AA RID: 6314
private static readonly int[] daysmonthleap = new int[]
{
0, 31, 29, 31, 30, 31, 30, 31, 31, 30,
31, 30, 31
};
// Token: 0x040018AB RID: 6315
private static object to_local_time_span_object;
// Token: 0x040018AC RID: 6316
private static long last_now;
// Token: 0x02000654 RID: 1620
private enum Which
{
// Token: 0x040018AE RID: 6318
Day,
// Token: 0x040018AF RID: 6319
DayYear,
// Token: 0x040018B0 RID: 6320
Month,
// Token: 0x040018B1 RID: 6321
Year
}
}
}