using System;
using System.Collections.Generic;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System
{
/// Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Universal Time (UTC).
/// 2
// Token: 0x02000656 RID: 1622
[Serializable]
[StructLayout(LayoutKind.Auto)]
public struct DateTimeOffset : IFormattable, IComparable, ISerializable, IComparable, IEquatable, IDeserializationCallback
{
/// Initializes a new instance of the structure using the specified value.
/// A date and time.
/// The Coordinated Universal Time (UTC) date and time that results from applying the offset is earlier than .-or-The UTC date and time that results from applying the offset is later than .
// Token: 0x06003DA3 RID: 15779 RVA: 0x000D0EB4 File Offset: 0x000CF0B4
public DateTimeOffset(DateTime dateTime)
{
this.dt = dateTime;
if (dateTime.Kind == DateTimeKind.Utc)
{
this.utc_offset = TimeSpan.Zero;
}
else
{
this.utc_offset = TimeZone.CurrentTimeZone.GetUtcOffset(dateTime);
}
if (this.UtcDateTime < DateTime.MinValue || this.UtcDateTime > DateTime.MaxValue)
{
throw new ArgumentOutOfRangeException("The UTC date and time that results from applying the offset is earlier than MinValue or later than MaxValue.");
}
}
/// Initializes a new instance of the structure using the specified value and offset.
/// A date and time.
/// The time's offset from Coordinated Universal Time (UTC).
///
/// equals and does not equal zero.-or- equals and does not equal the offset of the system's local time zone.-or- is not specified in whole minutes.
///
/// is less than -14 hours or greater than 14 hours.-or- is less than or greater than .
// Token: 0x06003DA4 RID: 15780 RVA: 0x000D0F2C File Offset: 0x000CF12C
public DateTimeOffset(DateTime dateTime, TimeSpan offset)
{
if (dateTime.Kind == DateTimeKind.Utc && offset != TimeSpan.Zero)
{
throw new ArgumentException("dateTime.Kind equals Utc and offset does not equal zero.");
}
if (dateTime.Kind == DateTimeKind.Local && offset != TimeZone.CurrentTimeZone.GetUtcOffset(dateTime))
{
throw new ArgumentException("dateTime.Kind equals Local and offset does not equal the offset of the system's local time zone.");
}
if (offset.Ticks % 600000000L != 0L)
{
throw new ArgumentException("offset is not specified in whole minutes.");
}
if (offset < new TimeSpan(-14, 0, 0) || offset > new TimeSpan(14, 0, 0))
{
throw new ArgumentOutOfRangeException("offset is less than -14 hours or greater than 14 hours.");
}
this.dt = dateTime;
this.utc_offset = offset;
if (this.UtcDateTime < DateTime.MinValue || this.UtcDateTime > DateTime.MaxValue)
{
throw new ArgumentOutOfRangeException("The UtcDateTime property is earlier than MinValue or later than MaxValue.");
}
}
/// Initializes a new instance of the structure using the specified number of ticks and offset.
/// A date and time expressed as the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight on January 1, 0001.
/// The time's offset from Coordinated Universal Time (UTC).
///
/// is not specified in whole minutes.
/// The property is earlier than or later than .-or- is less than DateTimeOffset.MinValue.Ticks or greater than DateTimeOffset.MaxValue.Ticks.-or- s less than -14 hours or greater than 14 hours.
// Token: 0x06003DA5 RID: 15781 RVA: 0x000D1024 File Offset: 0x000CF224
public DateTimeOffset(long ticks, TimeSpan offset)
{
this = new DateTimeOffset(new DateTime(ticks), offset);
}
/// Initializes a new instance of the structure using the specified year, month, day, hour, minute, second, and offset.
/// The year (1 through 9999).
/// The month (1 through 12).
/// The day (1 through the number of days in ).
/// The hours (0 through 23).
/// The minutes (0 through 59).
/// The seconds (0 through 59).
/// The time's offset from Coordinated Universal Time (UTC).
///
/// does not represent whole minutes.
///
/// is less than one or greater than 9999.-or- is less than one or greater than 12.-or- is less than one or greater than the number of days in .-or- is less than zero or greater than 23.-or- is less than 0 or greater than 59.-or- is less than 0 or greater than 59.-or- is less than -14 hours or greater than 14 hours.-or-The property is earlier than or later than .
// Token: 0x06003DA6 RID: 15782 RVA: 0x000D1034 File Offset: 0x000CF234
public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, TimeSpan offset)
{
this = new DateTimeOffset(new DateTime(year, month, day, hour, minute, second), offset);
}
/// Initializes a new instance of the structure using the specified year, month, day, hour, minute, second, millisecond, and offset.
/// The year (1 through 9999).
/// The month (1 through 12).
/// The day (1 through the number of days in ).
/// The hours (0 through 23).
/// The minutes (0 through 59).
/// The seconds (0 through 59).
/// The milliseconds (0 through 999).
/// The time's offset from Coordinated Universal Time (UTC).
///
/// does not represent whole minutes.
///
/// is less than one or greater than 9999.-or- is less than one or greater than 12.-or- is less than one or greater than the number of days in .-or- is less than zero or greater than 23.-or- is less than 0 or greater than 59.-or- is less than 0 or greater than 59.-or- is less than 0 or greater than 999.-or- is less than -14 or greater than 14.-or-The property is earlier than or later than .
// Token: 0x06003DA7 RID: 15783 RVA: 0x000D104C File Offset: 0x000CF24C
public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, TimeSpan offset)
{
this = new DateTimeOffset(new DateTime(year, month, day, hour, minute, second, millisecond), offset);
}
/// Initializes a new instance of the structure using the specified year, month, day, hour, minute, second, millisecond, and offset of a specified calendar.
/// The year.
/// The month (1 through 12).
/// The day (1 through the number of days in ).
/// The hours (0 through 23).
/// The minutes (0 through 59).
/// The seconds (0 through 59).
/// The milliseconds (0 through 999).
/// The calendar whose time is defined.
/// The time's offset from Coordinated Universal Time (UTC).
///
/// does not represent whole minutes.
///
/// cannot be null.
///
/// is less than the parameter's MinSupportedDateTime.Year or greater than MaxSupportedDateTime.Year.-or- is either less than or greater than the number of months in in the . -or- is less than one or greater than the number of days in .-or- is less than zero or greater than 23.-or- is less than 0 or greater than 59.-or- is less than 0 or greater than 59.-or- is less than 0 or greater than 999.-or- is less than -14 hours or greater than 14 hours.-or-The , , and parameters cannot be represented as a date and time value.-or-The property is earlier than or later than .
// Token: 0x06003DA8 RID: 15784 RVA: 0x000D1074 File Offset: 0x000CF274
public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, Calendar calendar, TimeSpan offset)
{
this = new DateTimeOffset(new DateTime(year, month, day, hour, minute, second, millisecond, calendar), offset);
}
// Token: 0x06003DA9 RID: 15785 RVA: 0x000D109C File Offset: 0x000CF29C
private DateTimeOffset(SerializationInfo info, StreamingContext context)
{
DateTime dateTime = (DateTime)info.GetValue("DateTime", typeof(DateTime));
short @int = info.GetInt16("OffsetMinutes");
this.utc_offset = TimeSpan.FromMinutes((double)@int);
this.dt = dateTime.Add(this.utc_offset);
}
// Token: 0x06003DAA RID: 15786 RVA: 0x000D10F0 File Offset: 0x000CF2F0
static DateTimeOffset()
{
if (MonoTouchAOTHelper.FalseFlag)
{
GenericComparer genericComparer = new GenericComparer();
GenericEqualityComparer genericEqualityComparer = new GenericEqualityComparer();
}
}
/// Compares the value of the current object with another object of the same type.
/// A 32-bit signed integer that indicates whether the current object is less than, equal to, or greater than . The return values of the method are interpreted as follows:Return ValueDescriptionLess than zeroThe current object is less than (earlier than) .ZeroThe current object is equal to (the same point in time as) .Greater than zeroThe current object is greater than (later than) .
/// The object to compare with the current object.
// Token: 0x06003DAB RID: 15787 RVA: 0x000D113C File Offset: 0x000CF33C
int IComparable.CompareTo(object obj)
{
return this.CompareTo((DateTimeOffset)obj);
}
/// Populates a object with the data required to serialize the current object.
/// The object to populate with data.
/// The destination for this serialization (see ).
/// The parameter is null.
// Token: 0x06003DAC RID: 15788 RVA: 0x000D114C File Offset: 0x000CF34C
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
DateTime dateTime = new DateTime(this.dt.Ticks);
DateTime dateTime2 = dateTime.Subtract(this.utc_offset);
info.AddValue("DateTime", dateTime2);
info.AddValue("OffsetMinutes", (short)this.utc_offset.TotalMinutes);
}
/// Runs when the deserialization of an object has been completed.
/// The object that initiated the callback. The functionality for this parameter is not currently implemented.
// Token: 0x06003DAD RID: 15789 RVA: 0x000D11B0 File Offset: 0x000CF3B0
[MonoTODO]
void IDeserializationCallback.OnDeserialization(object sender)
{
}
/// Adds a specified time interval to a object.
/// A object whose value is the sum of the date and time represented by the current object and the time interval represented by .
/// A object that represents a positive or a negative time interval.
/// The resulting value is less than .-or- The resulting value is greater than .
// Token: 0x06003DAE RID: 15790 RVA: 0x000D11B4 File Offset: 0x000CF3B4
public DateTimeOffset Add(TimeSpan timeSpan)
{
return new DateTimeOffset(this.dt.Add(timeSpan), this.utc_offset);
}
/// Adds a specified number of whole and fractional days to the current object.
/// A object whose value is the sum of the date and time represented by the current object and the number of days represented by .
/// A number of whole and fractional days. The number can be negative or positive.
/// The resulting value is less than .-or- The resulting value is greater than .
// Token: 0x06003DAF RID: 15791 RVA: 0x000D11D0 File Offset: 0x000CF3D0
public DateTimeOffset AddDays(double days)
{
return new DateTimeOffset(this.dt.AddDays(days), this.utc_offset);
}
/// Adds a specified number of whole and fractional hours to the current object.
/// A object whose value is the sum of the date and time represented by the current object and the number of hours represented by .
/// A number of whole and fractional hours. The number can be negative or positive.
/// The resulting value is less than .-or- The resulting value is greater than .
// Token: 0x06003DB0 RID: 15792 RVA: 0x000D11EC File Offset: 0x000CF3EC
public DateTimeOffset AddHours(double hours)
{
return new DateTimeOffset(this.dt.AddHours(hours), this.utc_offset);
}
/// Adds a specified number of milliseconds to the current object.
/// A object whose value is the sum of the date and time represented by the current object and the number of whole milliseconds represented by .
/// A number of whole and fractional milliseconds. The number can be negative or positive.
/// The resulting value is less than .-or- The resulting value is greater than .
// Token: 0x06003DB1 RID: 15793 RVA: 0x000D1208 File Offset: 0x000CF408
public DateTimeOffset AddMilliseconds(double milliseconds)
{
return new DateTimeOffset(this.dt.AddMilliseconds(milliseconds), this.utc_offset);
}
/// Adds a specified number of whole and fractional minutes to the current object.
/// A object whose value is the sum of the date and time represented by the current object and the number of minutes represented by .
/// A number of whole and fractional minutes. The number can be negative or positive.
/// The resulting value is less than .-or- The resulting value is greater than .
// Token: 0x06003DB2 RID: 15794 RVA: 0x000D1224 File Offset: 0x000CF424
public DateTimeOffset AddMinutes(double minutes)
{
return new DateTimeOffset(this.dt.AddMinutes(minutes), this.utc_offset);
}
/// Adds a specified number of months to the current object.
/// A object whose value is the sum of the date and time represented by the current object and the number of months represented by .
/// A number of whole months. The number can be negative or positive.
/// The resulting value is less than .-or- The resulting value is greater than .
// Token: 0x06003DB3 RID: 15795 RVA: 0x000D1240 File Offset: 0x000CF440
public DateTimeOffset AddMonths(int months)
{
return new DateTimeOffset(this.dt.AddMonths(months), this.utc_offset);
}
/// Adds a specified number of whole and fractional seconds to the current object.
/// A object whose value is the sum of the date and time represented by the current object and the number of seconds represented by .
/// A number of whole and fractional seconds. The number can be negative or positive.
/// The resulting value is less than .-or- The resulting value is greater than .
// Token: 0x06003DB4 RID: 15796 RVA: 0x000D125C File Offset: 0x000CF45C
public DateTimeOffset AddSeconds(double seconds)
{
return new DateTimeOffset(this.dt.AddSeconds(seconds), this.utc_offset);
}
/// Adds a specified number of ticks to the current object.
/// A object whose value is the sum of the date and time represented by the current object and the number of ticks represented by .
/// A number of 100-nanosecond ticks. The number can be negative or positive.
/// The resulting value is less than .-or- The resulting value is greater than .
// Token: 0x06003DB5 RID: 15797 RVA: 0x000D1278 File Offset: 0x000CF478
public DateTimeOffset AddTicks(long ticks)
{
return new DateTimeOffset(this.dt.AddTicks(ticks), this.utc_offset);
}
/// Adds a specified number of years to the object.
/// A object whose value is the sum of the date and time represented by the current object and the number of years represented by .
/// A number of years. The number can be negative or positive.
/// The resulting value is less than .-or- The resulting value is greater than .
// Token: 0x06003DB6 RID: 15798 RVA: 0x000D1294 File Offset: 0x000CF494
public DateTimeOffset AddYears(int years)
{
return new DateTimeOffset(this.dt.AddYears(years), this.utc_offset);
}
/// Compares two objects and indicates whether the first is earlier than the second, equal to the second, or later than the second.
/// A signed integer that indicates whether the value of the parameter is earlier than, later than, or the same time as the value of the parameter, as the following table shows.Return valueConditionLess than zero is earlier than .Zero is equal to .Greater than zero is later than .
/// The first object.
/// The second object.
// Token: 0x06003DB7 RID: 15799 RVA: 0x000D12B0 File Offset: 0x000CF4B0
public static int Compare(DateTimeOffset first, DateTimeOffset second)
{
return first.CompareTo(second);
}
/// Compares the current object to a specified object and indicates whether the current object is earlier than, the same as, or later than the second object.
/// A signed integer that indicates the relationship between the current object and , as the following table shows.Return ValueDescriptionLess than zeroThe current object is earlier than .ZeroThe current object is the same as .Greater than zero.The current object is later than .
/// A object to compare with the current object.
// Token: 0x06003DB8 RID: 15800 RVA: 0x000D12BC File Offset: 0x000CF4BC
public int CompareTo(DateTimeOffset other)
{
return this.UtcDateTime.CompareTo(other.UtcDateTime);
}
/// Determines whether the current object represents the same point in time as a specified object.
/// true if both objects have the same value; otherwise, false.
/// A object to compare to the current object.
// Token: 0x06003DB9 RID: 15801 RVA: 0x000D12E0 File Offset: 0x000CF4E0
public bool Equals(DateTimeOffset other)
{
return this.UtcDateTime == other.UtcDateTime;
}
/// Determines whether a object represents the same point in time as a specified object.
/// true if the parameter is a object and represents the same point in time as the current object; otherwise, false.
/// The object to compare to the current object.
// Token: 0x06003DBA RID: 15802 RVA: 0x000D12F4 File Offset: 0x000CF4F4
public override bool Equals(object obj)
{
return obj is DateTimeOffset && this.UtcDateTime == ((DateTimeOffset)obj).UtcDateTime;
}
/// Determines whether two specified objects represent the same point in time.
/// true if the two objects have the same value; otherwise, false.
/// The first object.
/// The second object.
// Token: 0x06003DBB RID: 15803 RVA: 0x000D1328 File Offset: 0x000CF528
public static bool Equals(DateTimeOffset first, DateTimeOffset second)
{
return first.Equals(second);
}
/// Determines whether the current object represents the same time and has the same offset as a specified object.
/// true if the current object and have the same date and time value and the same value; otherwise, false.
/// The object to compare to the current object.
// Token: 0x06003DBC RID: 15804 RVA: 0x000D1334 File Offset: 0x000CF534
public bool EqualsExact(DateTimeOffset other)
{
return this.dt == other.dt && this.utc_offset == other.utc_offset;
}
/// Converts the specified Windows file time to an equivalent local time.
/// A object that represents the date and time of with the offset set to the local time offset.
/// A Windows file time, expressed in ticks.
///
/// is less than zero.-or- is greater than DateTimeOffset.MaxValue.Ticks.
// Token: 0x06003DBD RID: 15805 RVA: 0x000D1370 File Offset: 0x000CF570
public static DateTimeOffset FromFileTime(long fileTime)
{
if (fileTime < 0L || fileTime > DateTimeOffset.MaxValue.Ticks)
{
throw new ArgumentOutOfRangeException("fileTime is less than zero or greater than DateTimeOffset.MaxValue.Ticks.");
}
return new DateTimeOffset(DateTime.FromFileTime(fileTime), TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.FromFileTime(fileTime)));
}
/// Returns the hash code for the current object.
/// A 32-bit signed integer hash code.
// Token: 0x06003DBE RID: 15806 RVA: 0x000D13C0 File Offset: 0x000CF5C0
public override int GetHashCode()
{
return this.dt.GetHashCode() ^ this.utc_offset.GetHashCode();
}
/// Converts the specified string representation of a date, time, and offset to its equivalent.
/// A object that is equivalent to the date and time that is contained in .
/// A string that contains a date and time to convert.
/// The offset is greater than 14 hours or less than -14 hours.
///
/// is null.
///
/// does not contain a valid string representation of a date and time.-or- contains the string representation of an offset value without a date or time.
// Token: 0x06003DBF RID: 15807 RVA: 0x000D13DC File Offset: 0x000CF5DC
public static DateTimeOffset Parse(string input)
{
return DateTimeOffset.Parse(input, null);
}
/// Converts the specified string representation of a date and time to its equivalent using the specified culture-specific format information.
/// A equivalent to the date and time that is contained in as specified by .
/// A string that contains a date and time to convert.
/// An object that provides culture-specific format information about .
/// The offset is greater than 14 hours or less than -14 hours.
///
/// is null.
///
/// does not contain a valid string representation of a date and time.-or- contains the string representation of an offset value without a date or time.
// Token: 0x06003DC0 RID: 15808 RVA: 0x000D13E8 File Offset: 0x000CF5E8
public static DateTimeOffset Parse(string input, IFormatProvider formatProvider)
{
return DateTimeOffset.Parse(input, formatProvider, DateTimeStyles.AllowWhiteSpaces);
}
/// Converts the specified string representation of a date and time to its equivalent using the specified culture-specific format information and formatting style.
/// A object that is equivalent to the date and time that is contained in as specified by and .
/// A string that contains a date and time to convert.
/// An object that provides culture-specific format information about .
/// A bitwise combination of values that indicates the permitted format of . A typical value to specify is .
/// The offset is greater than 14 hours or less than -14 hours.-or- is not a valid value.-or- includes an unsupported value.-or- includes values that cannot be used together.
///
/// is null.
///
/// does not contain a valid string representation of a date and time.-or- contains the string representation of an offset value without a date or time.
// Token: 0x06003DC1 RID: 15809 RVA: 0x000D13F4 File Offset: 0x000CF5F4
public static DateTimeOffset Parse(string input, IFormatProvider formatProvider, DateTimeStyles styles)
{
if (input == null)
{
throw new ArgumentNullException("input");
}
Exception ex = null;
DateTime dateTime;
DateTimeOffset dateTimeOffset;
if (!DateTime.CoreParse(input, formatProvider, styles, out dateTime, out dateTimeOffset, true, ref ex))
{
throw ex;
}
if (dateTime.Ticks != 0L && dateTimeOffset.Ticks == 0L)
{
throw new ArgumentOutOfRangeException("The UTC representation falls outside the 1-9999 year range");
}
return dateTimeOffset;
}
/// Converts the specified string representation of a date and time to its equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.
/// A object that is equivalent to the date and time that is contained in as specified by and .
/// A string that contains a date and time to convert.
/// A format specifier that defines the expected format of .
/// An object that supplies culture-specific formatting information about .
/// The offset is greater than 14 hours or less than -14 hours.
///
/// is null.-or- is null.
///
/// is an empty string ("").-or- does not contain a valid string representation of a date and time.-or- is an empty string.
// Token: 0x06003DC2 RID: 15810 RVA: 0x000D1450 File Offset: 0x000CF650
public static DateTimeOffset ParseExact(string input, string format, IFormatProvider formatProvider)
{
return DateTimeOffset.ParseExact(input, format, formatProvider, DateTimeStyles.AssumeLocal);
}
/// Converts the specified string representation of a date and time to its equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly.
/// A equivalent to the date and time that is contained in the parameter as specified by the , , and parameters.
/// A string that contains a date and time to convert.
/// A format specifier that defines the expected format of .
/// An object that supplies culture-specific formatting information about .
/// A bitwise combination of values that indicates the permitted format of .
/// The offset is greater than 14 hours or less than -14 hours.-or-The parameter includes an unsupported value.-or-The parameter contains values that cannot be used together.
///
/// is null.-or- is null.
///
/// is an empty string ("").-or- does not contain a valid string representation of a date and time.-or- is an empty string.
// Token: 0x06003DC3 RID: 15811 RVA: 0x000D145C File Offset: 0x000CF65C
public static DateTimeOffset ParseExact(string input, string format, IFormatProvider formatProvider, DateTimeStyles styles)
{
if (format == null)
{
throw new ArgumentNullException("format");
}
if (format == string.Empty)
{
throw new FormatException("format is an empty string");
}
return DateTimeOffset.ParseExact(input, new string[] { format }, formatProvider, styles);
}
/// Converts the specified string representation of a date and time to its equivalent using the specified formats, culture-specific format information, and style. The format of the string representation must match one of the specified formats exactly.
/// A equivalent to the date and time that is contained in the parameter as specified by the , , and parameters.
/// A string that contains a date and time to convert.
/// An array of format specifiers that define the expected formats of .
/// An object that supplies culture-specific formatting information about .
/// A bitwise combination of values that indicates the permitted format of .
/// The offset is greater than 14 hours or less than -14 hours.-or- includes an unsupported value.-or-The parameter contains values that cannot be used together.
///
/// is null.
///
/// is an empty string ("").-or- does not contain a valid string representation of a date and time.-or-No element of contains a valid format specifier.
// Token: 0x06003DC4 RID: 15812 RVA: 0x000D14A8 File Offset: 0x000CF6A8
public static DateTimeOffset ParseExact(string input, string[] formats, IFormatProvider formatProvider, DateTimeStyles styles)
{
if (input == null)
{
throw new ArgumentNullException("input");
}
if (input == string.Empty)
{
throw new FormatException("input is an empty string");
}
if (formats == null)
{
throw new ArgumentNullException("formats");
}
if (formats.Length == 0)
{
throw new FormatException("Invalid format specifier");
}
if ((styles & DateTimeStyles.AssumeLocal) != DateTimeStyles.None && (styles & DateTimeStyles.AssumeUniversal) != DateTimeStyles.None)
{
throw new ArgumentException("styles parameter contains incompatible flags");
}
DateTimeOffset dateTimeOffset;
if (!DateTimeOffset.ParseExact(input, formats, DateTimeFormatInfo.GetInstance(formatProvider), styles, out dateTimeOffset))
{
throw new FormatException("Invalid format string");
}
return dateTimeOffset;
}
// Token: 0x06003DC5 RID: 15813 RVA: 0x000D1544 File Offset: 0x000CF744
private static bool ParseExact(string input, string[] formats, DateTimeFormatInfo dfi, DateTimeStyles styles, out DateTimeOffset ret)
{
foreach (string text in formats)
{
if (text == null || text == string.Empty)
{
throw new FormatException("Invalid format string");
}
DateTimeOffset dateTimeOffset;
if (DateTimeOffset.DoParse(input, text, false, out dateTimeOffset, dfi, styles))
{
ret = dateTimeOffset;
return true;
}
}
ret = DateTimeOffset.MinValue;
return false;
}
// Token: 0x06003DC6 RID: 15814 RVA: 0x000D15B4 File Offset: 0x000CF7B4
private static bool DoParse(string input, string format, bool exact, out DateTimeOffset result, DateTimeFormatInfo dfi, DateTimeStyles styles)
{
if ((styles & DateTimeStyles.AllowLeadingWhite) != DateTimeStyles.None)
{
format = format.TrimStart(null);
input = input.TrimStart(null);
}
if ((styles & DateTimeStyles.AllowTrailingWhite) != DateTimeStyles.None)
{
format = format.TrimEnd(null);
input = input.TrimEnd(null);
}
bool flag = false;
if ((styles & DateTimeStyles.AllowInnerWhite) != DateTimeStyles.None)
{
flag = true;
}
bool flag2 = false;
bool flag3 = false;
if (format.Length == 1)
{
format = DateTimeUtils.GetStandardPattern(format[0], dfi, out flag2, out flag3, true);
}
int num = -1;
int num2 = -1;
int num3 = -1;
int num4 = -1;
int num5 = -1;
int num6 = -1;
int num7 = -1;
double num8 = -1.0;
int num9 = -1;
TimeSpan timeSpan = TimeSpan.MinValue;
result = DateTimeOffset.MinValue;
int i = 0;
int num10 = 0;
while (i < format.Length)
{
char c = format[i];
char c2 = c;
int num11;
switch (c2)
{
case 's':
num11 = DateTimeUtils.CountRepeat(format, i, c);
if (num7 != -1 || num11 > 2)
{
return false;
}
num10 += DateTimeOffset.ParseNumber(input, num10, 2, num11 == 2, flag, out num7);
break;
case 't':
{
num11 = DateTimeUtils.CountRepeat(format, i, c);
if (num5 != -1 || num11 > 2)
{
return false;
}
int num12 = num10;
string text = input;
int num13 = num10;
string[] array2;
if (num11 == 1)
{
string[] array = new string[2];
array[0] = new string(dfi.AMDesignator[0], 1);
array2 = array;
array[1] = new string(dfi.PMDesignator[0], 0);
}
else
{
string[] array3 = new string[2];
array3[0] = dfi.AMDesignator;
array2 = array3;
array3[1] = dfi.PMDesignator;
}
num10 = num12 + DateTimeOffset.ParseEnum(text, num13, array2, flag, out num9);
if (num9 == -1)
{
return false;
}
if (num4 == -1)
{
num4 = num9 * 12;
}
else
{
num5 = num4 + num9 * 12;
}
break;
}
default:
switch (c2)
{
case 'd':
num11 = DateTimeUtils.CountRepeat(format, i, c);
if (num3 != -1 || num11 > 4)
{
return false;
}
if (num11 <= 2)
{
num10 += DateTimeOffset.ParseNumber(input, num10, 2, num11 == 2, flag, out num3);
}
else
{
num10 += DateTimeOffset.ParseEnum(input, num10, (num11 != 3) ? dfi.DayNames : dfi.AbbreviatedDayNames, flag, out num9);
}
break;
default:
switch (c2)
{
case 'F':
{
num11 = DateTimeUtils.CountRepeat(format, i, c);
int num15;
int num14 = DateTimeOffset.ParseNumber(input, num10, num11, true, flag, out num9, out num15);
if (num9 == -1)
{
num10 += DateTimeOffset.ParseNumber(input, num10, num15, true, flag, out num9);
}
else
{
num10 += num14;
}
if (num8 >= 0.0 || num11 > 7 || num9 == -1)
{
return false;
}
num8 = (double)num9 / Math.Pow(10.0, (double)num15);
break;
}
default:
if (c2 != ' ')
{
if (c2 != '%')
{
if (c2 != '/')
{
if (c2 != ':')
{
if (c2 != 'M')
{
if (c2 != '\\')
{
if (c2 != 'm')
{
num11 = 1;
num10 += DateTimeOffset.ParseChar(input, num10, format[i], flag, out num9);
if (num9 == -1)
{
return false;
}
}
else
{
num11 = DateTimeUtils.CountRepeat(format, i, c);
if (num6 != -1 || num11 > 2)
{
return false;
}
num10 += DateTimeOffset.ParseNumber(input, num10, 2, num11 == 2, flag, out num6);
}
}
else
{
num11 = 2;
num10 += DateTimeOffset.ParseChar(input, num10, format[i + 1], flag, out num9);
if (num9 == -1)
{
return false;
}
}
}
else
{
num11 = DateTimeUtils.CountRepeat(format, i, c);
if (num2 != -1 || num11 > 4)
{
return false;
}
if (num11 <= 2)
{
num10 += DateTimeOffset.ParseNumber(input, num10, 2, num11 == 2, flag, out num2);
}
else
{
num10 += DateTimeOffset.ParseEnum(input, num10, (num11 != 3) ? dfi.MonthNames : dfi.AbbreviatedMonthNames, flag, out num2);
num2++;
}
}
}
else
{
num11 = 1;
num10 += DateTimeOffset.ParseEnum(input, num10, new string[] { dfi.TimeSeparator }, false, out num9);
if (num9 == -1)
{
return false;
}
}
}
else
{
num11 = 1;
num10 += DateTimeOffset.ParseEnum(input, num10, new string[] { dfi.DateSeparator }, false, out num9);
if (num9 == -1)
{
return false;
}
}
}
else
{
num11 = 1;
if (i != 0)
{
return false;
}
}
}
else
{
num11 = 1;
num10 += DateTimeOffset.ParseChar(input, num10, ' ', false, out num9);
if (num9 == -1)
{
return false;
}
}
break;
case 'H':
num11 = DateTimeUtils.CountRepeat(format, i, c);
if (num5 != -1 || num11 > 2)
{
return false;
}
num10 += DateTimeOffset.ParseNumber(input, num10, 2, num11 == 2, flag, out num5);
break;
}
break;
case 'f':
num11 = DateTimeUtils.CountRepeat(format, i, c);
num10 += DateTimeOffset.ParseNumber(input, num10, num11, true, flag, out num9);
if (num8 >= 0.0 || num11 > 7 || num9 == -1)
{
return false;
}
num8 = (double)num9 / Math.Pow(10.0, (double)num11);
break;
case 'h':
num11 = DateTimeUtils.CountRepeat(format, i, c);
if (num5 != -1 || num11 > 2)
{
return false;
}
num10 += DateTimeOffset.ParseNumber(input, num10, 2, num11 == 2, flag, out num9);
if (num9 == -1)
{
return false;
}
if (num4 == -1)
{
num4 = num9;
}
else
{
num5 = num4 + num9;
}
break;
}
break;
case 'y':
if (num != -1)
{
return false;
}
num11 = DateTimeUtils.CountRepeat(format, i, c);
if (num11 <= 2)
{
num10 += DateTimeOffset.ParseNumber(input, num10, 2, num11 == 2, flag, out num);
if (num != -1)
{
num += DateTime.Now.Year - DateTime.Now.Year % 100;
}
}
else if (num11 <= 4)
{
int num16;
num10 += DateTimeOffset.ParseNumber(input, num10, 5, false, flag, out num, out num16);
if (num16 < num11 || (num16 > num11 && (double)num / Math.Pow(10.0, (double)(num16 - 1)) < 1.0))
{
return false;
}
}
else
{
num10 += DateTimeOffset.ParseNumber(input, num10, num11, true, flag, out num);
}
break;
case 'z':
{
num11 = DateTimeUtils.CountRepeat(format, i, c);
if (timeSpan != TimeSpan.MinValue || num11 > 3)
{
return false;
}
int num17 = 0;
num9 = 0;
int num18;
num10 += DateTimeOffset.ParseEnum(input, num10, new string[] { "-", "+" }, flag, out num18);
int num19;
num10 += DateTimeOffset.ParseNumber(input, num10, 2, num11 != 1, false, out num19);
if (num11 == 3)
{
num10 += DateTimeOffset.ParseEnum(input, num10, new string[] { dfi.TimeSeparator }, false, out num9);
num10 += DateTimeOffset.ParseNumber(input, num10, 2, true, false, out num17);
}
if (num19 == -1 || num17 == -1 || num18 == -1)
{
return false;
}
if (num18 == 0)
{
num18 = -1;
}
timeSpan = new TimeSpan(num18 * num19, num18 * num17, 0);
break;
}
}
i += num11;
}
if (timeSpan == TimeSpan.MinValue && (styles & DateTimeStyles.AssumeLocal) != DateTimeStyles.None)
{
timeSpan = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
}
if (timeSpan == TimeSpan.MinValue && (styles & DateTimeStyles.AssumeUniversal) != DateTimeStyles.None)
{
timeSpan = TimeSpan.Zero;
}
if (num5 < 0)
{
num5 = 0;
}
if (num6 < 0)
{
num6 = 0;
}
if (num7 < 0)
{
num7 = 0;
}
if (num8 < 0.0)
{
num8 = 0.0;
}
if (num > 0 && num2 > 0 && num3 > 0)
{
result = new DateTimeOffset(num, num2, num3, num5, num6, num7, 0, timeSpan);
result = result.AddSeconds(num8);
if ((styles & DateTimeStyles.AdjustToUniversal) != DateTimeStyles.None)
{
result = result.ToUniversalTime();
}
return true;
}
return false;
}
// Token: 0x06003DC7 RID: 15815 RVA: 0x000D1E30 File Offset: 0x000D0030
private static int ParseNumber(string input, int pos, int digits, bool leading_zero, bool allow_leading_white, out int result)
{
int num;
return DateTimeOffset.ParseNumber(input, pos, digits, leading_zero, allow_leading_white, out result, out num);
}
// Token: 0x06003DC8 RID: 15816 RVA: 0x000D1E4C File Offset: 0x000D004C
private static int ParseNumber(string input, int pos, int digits, bool leading_zero, bool allow_leading_white, out int result, out int digit_parsed)
{
int num = 0;
digit_parsed = 0;
result = 0;
while (allow_leading_white && pos < input.Length && input[pos] == ' ')
{
num++;
pos++;
}
while (pos < input.Length && char.IsDigit(input[pos]) && digits > 0)
{
result = 10 * result + (int)((byte)(input[pos] - '0'));
pos++;
num++;
digit_parsed++;
digits--;
}
if (leading_zero && digits > 0)
{
result = -1;
}
if (digit_parsed == 0)
{
result = -1;
}
return num;
}
// Token: 0x06003DC9 RID: 15817 RVA: 0x000D1F04 File Offset: 0x000D0104
private static int ParseEnum(string input, int pos, string[] enums, bool allow_leading_white, out int result)
{
int num = 0;
result = -1;
while (allow_leading_white && pos < input.Length && input[pos] == ' ')
{
num++;
pos++;
}
for (int i = 0; i < enums.Length; i++)
{
if (input.Substring(pos).StartsWith(enums[i]))
{
result = i;
break;
}
}
if (result >= 0)
{
num += enums[result].Length;
}
return num;
}
// Token: 0x06003DCA RID: 15818 RVA: 0x000D1F90 File Offset: 0x000D0190
private static int ParseChar(string input, int pos, char c, bool allow_leading_white, out int result)
{
int num = 0;
result = -1;
while (allow_leading_white && pos < input.Length && input[pos] == ' ')
{
pos++;
num++;
}
if (pos < input.Length && input[pos] == c)
{
result = (int)c;
num++;
}
return num;
}
/// Subtracts a value that represents a specific date and time from the current object.
/// A object that specifies the interval between the two objects.
/// A object.
// Token: 0x06003DCB RID: 15819 RVA: 0x000D1FF4 File Offset: 0x000D01F4
public TimeSpan Subtract(DateTimeOffset value)
{
return this.UtcDateTime - value.UtcDateTime;
}
/// Subtracts a specified time interval from the current object.
/// A object that is equal to the date and time represented by the current object, minus the time interval represented by .
/// A object that represents a time interval.
/// The resulting value is less than .-or- The resulting value is greater than .
// Token: 0x06003DCC RID: 15820 RVA: 0x000D2008 File Offset: 0x000D0208
public DateTimeOffset Subtract(TimeSpan value)
{
return this.Add(-value);
}
/// Converts the value of the current object to a Windows file time.
/// The value of the current object, expressed as a Windows file time.
/// The resulting file time would represent a date and time before midnight on January 1, 1601 C.E. Coordinated Universal Time (UTC).
// Token: 0x06003DCD RID: 15821 RVA: 0x000D2018 File Offset: 0x000D0218
public long ToFileTime()
{
return this.UtcDateTime.ToFileTime();
}
/// Converts the current object to a object that represents the local time.
/// A object that represents the date and time of the current object converted to local time.
// Token: 0x06003DCE RID: 15822 RVA: 0x000D2034 File Offset: 0x000D0234
public DateTimeOffset ToLocalTime()
{
return new DateTimeOffset(this.UtcDateTime.ToLocalTime(), TimeZone.CurrentTimeZone.GetUtcOffset(this.UtcDateTime.ToLocalTime()));
}
/// Converts the value of the current object to the date and time specified by an offset value.
/// A object that is equal to the original object (that is, their methods return identical points in time) but whose property is set to .
/// The offset to convert the value to.
/// The resulting object has a value earlier than .-or-The resulting object has a value later than .
///
/// is less than -14 hours.-or- is greater than 14 hours.
// Token: 0x06003DCF RID: 15823 RVA: 0x000D206C File Offset: 0x000D026C
public DateTimeOffset ToOffset(TimeSpan offset)
{
return new DateTimeOffset(this.dt - this.utc_offset + offset, offset);
}
/// Converts the value of the current object to its equivalent string representation.
/// A string representation of a object that includes the offset appended at the end of the string.
/// The date and time is outside the range of dates supported by the calendar used by the current culture.
// Token: 0x06003DD0 RID: 15824 RVA: 0x000D208C File Offset: 0x000D028C
public override string ToString()
{
return this.ToString(null, null);
}
/// Converts the value of the current object to its equivalent string representation using the specified culture-specific formatting information.
/// A string representation of the value of the current object, as specified by .
/// An object that supplies culture-specific formatting information.
/// The date and time is outside the range of dates supported by the calendar used by .
// Token: 0x06003DD1 RID: 15825 RVA: 0x000D2098 File Offset: 0x000D0298
public string ToString(IFormatProvider formatProvider)
{
return this.ToString(null, formatProvider);
}
/// Converts the value of the current object to its equivalent string representation using the specified format.
/// A string representation of the value of the current object, as specified by .
/// A format string.
/// The length of is one, and it is not one of the standard format specifier characters defined for . -or- does not contain a valid custom format pattern.
/// The date and time is outside the range of dates supported by the calendar used by the current culture.
// Token: 0x06003DD2 RID: 15826 RVA: 0x000D20A4 File Offset: 0x000D02A4
public string ToString(string format)
{
return this.ToString(format, null);
}
/// Converts the value of the current object to its equivalent string representation using the specified format and culture-specific format information.
/// A string representation of the value of the current object, as specified by and .
/// A format string.
/// An object that supplies culture-specific formatting information.
/// The length of is one, and it is not one of the standard format specifier characters defined for .-or- does not contain a valid custom format pattern.
/// The date and time is outside the range of dates supported by the calendar used by .
// Token: 0x06003DD3 RID: 15827 RVA: 0x000D20B0 File Offset: 0x000D02B0
public string ToString(string format, IFormatProvider formatProvider)
{
DateTimeFormatInfo instance = DateTimeFormatInfo.GetInstance(formatProvider);
if (format == null || format == string.Empty)
{
format = instance.ShortDatePattern + " " + instance.LongTimePattern + " zzz";
}
bool flag = false;
bool flag2 = false;
if (format.Length == 1)
{
char c = format[0];
try
{
format = DateTimeUtils.GetStandardPattern(c, instance, out flag, out flag2, true);
}
catch
{
format = null;
}
if (format == null)
{
throw new FormatException("format is not one of the format specifier characters defined for DateTimeFormatInfo");
}
}
return (!flag) ? DateTimeUtils.ToString(this.DateTime, new TimeSpan?(this.Offset), format, instance) : DateTimeUtils.ToString(this.UtcDateTime, new TimeSpan?(TimeSpan.Zero), format, instance);
}
/// Converts the current object to a value that represents the Coordinated Universal Time (UTC).
/// A object that represents the date and time of the current object converted to Coordinated Universal Time (UTC).
// Token: 0x06003DD4 RID: 15828 RVA: 0x000D2194 File Offset: 0x000D0394
public DateTimeOffset ToUniversalTime()
{
return new DateTimeOffset(this.UtcDateTime, TimeSpan.Zero);
}
/// Tries to converts a specified string representation of a date and time to its equivalent, and returns a value that indicates whether the conversion succeeded.
/// true if the parameter is successfully converted; otherwise, false.
/// A string that contains a date and time to convert.
/// When the method returns, contains the equivalent to the date and time of , if the conversion succeeded, or , if the conversion failed. The conversion fails if the parameter is null or does not contain a valid string representation of a date and time. This parameter is passed uninitialized.
// Token: 0x06003DD5 RID: 15829 RVA: 0x000D21A8 File Offset: 0x000D03A8
public static bool TryParse(string input, out DateTimeOffset result)
{
bool flag;
try
{
result = DateTimeOffset.Parse(input);
flag = true;
}
catch
{
result = DateTimeOffset.MinValue;
flag = false;
}
return flag;
}
/// Tries to convert a specified string representation of a date and time to its equivalent, and returns a value that indicates whether the conversion succeeded.
/// true if the parameter is successfully converted; otherwise, false.
/// A string that contains a date and time to convert.
/// An object that provides culture-specific formatting information about .
/// A bitwise combination of values that indicates the permitted format of .
/// When the method returns, contains the value equivalent to the date and time of , if the conversion succeeded, or , if the conversion failed. The conversion fails if the parameter is null or does not contain a valid string representation of a date and time. This parameter is passed uninitialized.
///
/// includes an undefined value.-or- is not supported.-or- includes mutually exclusive values.
// Token: 0x06003DD6 RID: 15830 RVA: 0x000D2204 File Offset: 0x000D0404
public static bool TryParse(string input, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result)
{
bool flag;
try
{
result = DateTimeOffset.Parse(input, formatProvider, styles);
flag = true;
}
catch
{
result = DateTimeOffset.MinValue;
flag = false;
}
return flag;
}
/// Converts the specified string representation of a date and time to its equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly.
/// true if the parameter is successfully converted; otherwise, false.
/// A string that contains a date and time to convert.
/// A format specifier that defines the required format of .
/// An object that supplies culture-specific formatting information about .
/// A bitwise combination of values that indicates the permitted format of input. A typical value to specify is None.
/// When the method returns, contains the equivalent to the date and time of , if the conversion succeeded, or , if the conversion failed. The conversion fails if the parameter is null, or does not contain a valid string representation of a date and time in the expected format defined by and . This parameter is passed uninitialized.
///
/// includes an undefined value.-or- is not supported.-or- includes mutually exclusive values.
// Token: 0x06003DD7 RID: 15831 RVA: 0x000D2260 File Offset: 0x000D0460
public static bool TryParseExact(string input, string format, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result)
{
bool flag;
try
{
result = DateTimeOffset.ParseExact(input, format, formatProvider, styles);
flag = true;
}
catch
{
result = DateTimeOffset.MinValue;
flag = false;
}
return flag;
}
/// Converts the specified string representation of a date and time to its equivalent using the specified array of formats, culture-specific format information, and style. The format of the string representation must match one of the specified formats exactly.
/// true if the parameter is successfully converted; otherwise, false.
/// A string that contains a date and time to convert.
/// An array that defines the expected formats of .
/// An object that supplies culture-specific formatting information about .
/// A bitwise combination of values that indicates the permitted format of input. A typical value to specify is None.
/// When the method returns, contains the equivalent to the date and time of , if the conversion succeeded, or , if the conversion failed. The conversion fails if the does not contain a valid string representation of a date and time, or does not contain the date and time in the expected format defined by , or if is null. This parameter is passed uninitialized.
///
/// includes an undefined value.-or- is not supported.-or- includes mutually exclusive values.
// Token: 0x06003DD8 RID: 15832 RVA: 0x000D22C0 File Offset: 0x000D04C0
public static bool TryParseExact(string input, string[] formats, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result)
{
bool flag;
try
{
result = DateTimeOffset.ParseExact(input, formats, formatProvider, styles);
flag = true;
}
catch
{
result = DateTimeOffset.MinValue;
flag = false;
}
return flag;
}
/// Gets a value that represents the date component of the current object.
/// A value that represents the date component of the current object.
// Token: 0x17000B77 RID: 2935
// (get) Token: 0x06003DD9 RID: 15833 RVA: 0x000D2320 File Offset: 0x000D0520
public DateTime Date
{
get
{
return DateTime.SpecifyKind(this.dt.Date, DateTimeKind.Unspecified);
}
}
/// Gets a value that represents the date and time of the current object.
/// A value that represents the date and time of the current object.
// Token: 0x17000B78 RID: 2936
// (get) Token: 0x06003DDA RID: 15834 RVA: 0x000D2334 File Offset: 0x000D0534
public DateTime DateTime
{
get
{
return DateTime.SpecifyKind(this.dt, DateTimeKind.Unspecified);
}
}
/// Gets the day of the month represented by the current object.
/// The day component of the current object, expressed as a value between 1 and 31.
// Token: 0x17000B79 RID: 2937
// (get) Token: 0x06003DDB RID: 15835 RVA: 0x000D2344 File Offset: 0x000D0544
public int Day
{
get
{
return this.dt.Day;
}
}
/// Gets the day of the week represented by the current object.
/// One of the values that indicates the day of the week of the current object.
// Token: 0x17000B7A RID: 2938
// (get) Token: 0x06003DDC RID: 15836 RVA: 0x000D2354 File Offset: 0x000D0554
public DayOfWeek DayOfWeek
{
get
{
return this.dt.DayOfWeek;
}
}
/// Gets the day of the year represented by the current object.
/// The day of the year of the current object, expressed as a value between 1 and 366.
// Token: 0x17000B7B RID: 2939
// (get) Token: 0x06003DDD RID: 15837 RVA: 0x000D2364 File Offset: 0x000D0564
public int DayOfYear
{
get
{
return this.dt.DayOfYear;
}
}
/// Gets the hour component of the time represented by the current object.
/// The hour component of the current object. This property uses a 24-hour clock; the value ranges from 0 to 23.
// Token: 0x17000B7C RID: 2940
// (get) Token: 0x06003DDE RID: 15838 RVA: 0x000D2374 File Offset: 0x000D0574
public int Hour
{
get
{
return this.dt.Hour;
}
}
/// Gets a value that represents the local date and time of the current object.
/// A value that represents the local date and time of the current object.
// Token: 0x17000B7D RID: 2941
// (get) Token: 0x06003DDF RID: 15839 RVA: 0x000D2384 File Offset: 0x000D0584
public DateTime LocalDateTime
{
get
{
return this.UtcDateTime.ToLocalTime();
}
}
/// Gets the millisecond component of the time represented by the current object.
/// The millisecond component of the current object, expressed as an integer between 0 and 999.
// Token: 0x17000B7E RID: 2942
// (get) Token: 0x06003DE0 RID: 15840 RVA: 0x000D23A0 File Offset: 0x000D05A0
public int Millisecond
{
get
{
return this.dt.Millisecond;
}
}
/// Gets the minute component of the time represented by the current object.
/// The minute component of the current object, expressed as an integer between 0 and 59.
// Token: 0x17000B7F RID: 2943
// (get) Token: 0x06003DE1 RID: 15841 RVA: 0x000D23B0 File Offset: 0x000D05B0
public int Minute
{
get
{
return this.dt.Minute;
}
}
/// Gets the month component of the date represented by the current object.
/// The month component of the current object, expressed as an integer between 1 and 12.
// Token: 0x17000B80 RID: 2944
// (get) Token: 0x06003DE2 RID: 15842 RVA: 0x000D23C0 File Offset: 0x000D05C0
public int Month
{
get
{
return this.dt.Month;
}
}
/// Gets a object that is set to the current date and time on the current computer, with the offset set to the local time's offset from Coordinated Universal Time (UTC).
/// A object whose date and time is the current local time and whose offset is the local time zone's offset from Coordinated Universal Time (UTC).
// Token: 0x17000B81 RID: 2945
// (get) Token: 0x06003DE3 RID: 15843 RVA: 0x000D23D0 File Offset: 0x000D05D0
public static DateTimeOffset Now
{
get
{
return new DateTimeOffset(DateTime.Now);
}
}
/// Gets the time's offset from Coordinated Universal Time (UTC).
/// A object that represents the difference between the current object's time value and Coordinated Universal Time (UTC).
// Token: 0x17000B82 RID: 2946
// (get) Token: 0x06003DE4 RID: 15844 RVA: 0x000D23DC File Offset: 0x000D05DC
public TimeSpan Offset
{
get
{
return this.utc_offset;
}
}
/// Gets the second component of the clock time represented by the current object.
/// The second component of the object, expressed as an integer value between 0 and 59.
// Token: 0x17000B83 RID: 2947
// (get) Token: 0x06003DE5 RID: 15845 RVA: 0x000D23E4 File Offset: 0x000D05E4
public int Second
{
get
{
return this.dt.Second;
}
}
/// Gets the number of ticks that represents the date and time of the current object in clock time.
/// An value that represents the number of ticks in the object's clock time.
// Token: 0x17000B84 RID: 2948
// (get) Token: 0x06003DE6 RID: 15846 RVA: 0x000D23F4 File Offset: 0x000D05F4
public long Ticks
{
get
{
return this.dt.Ticks;
}
}
/// Gets the time of day for the current object.
/// A object that represents the time interval of the current date that has elapsed since midnight.
// Token: 0x17000B85 RID: 2949
// (get) Token: 0x06003DE7 RID: 15847 RVA: 0x000D2404 File Offset: 0x000D0604
public TimeSpan TimeOfDay
{
get
{
return this.dt.TimeOfDay;
}
}
/// Gets a value that represents the Coordinated Universal Time (UTC) date and time of the current object.
/// A value that represents the Coordinated Universal Time (UTC) date and time of the current object.
// Token: 0x17000B86 RID: 2950
// (get) Token: 0x06003DE8 RID: 15848 RVA: 0x000D2414 File Offset: 0x000D0614
public DateTime UtcDateTime
{
get
{
return DateTime.SpecifyKind(this.dt - this.utc_offset, DateTimeKind.Utc);
}
}
/// Gets a object whose date and time are set to the current Coordinated Universal Time (UTC) date and time and whose offset is .
/// A value whose date and time is the current Coordinated Universal Time (UTC) and whose offset is .
// Token: 0x17000B87 RID: 2951
// (get) Token: 0x06003DE9 RID: 15849 RVA: 0x000D2430 File Offset: 0x000D0630
public static DateTimeOffset UtcNow
{
get
{
return new DateTimeOffset(DateTime.UtcNow);
}
}
/// Gets the number of ticks that represents the date and time of the current object in Coordinated Universal Time (UTC).
/// An value that represents the number of ticks in the object's Coordinated Universal Time (UTC).
// Token: 0x17000B88 RID: 2952
// (get) Token: 0x06003DEA RID: 15850 RVA: 0x000D243C File Offset: 0x000D063C
public long UtcTicks
{
get
{
return this.UtcDateTime.Ticks;
}
}
/// Gets the year component of the date represented by the current object.
/// The year component of the current object, expressed as an integer value between 0 and 9999.
// Token: 0x17000B89 RID: 2953
// (get) Token: 0x06003DEB RID: 15851 RVA: 0x000D2458 File Offset: 0x000D0658
public int Year
{
get
{
return this.dt.Year;
}
}
/// Adds a specified time interval to a object that has a specified date and time, and yields a object that has new a date and time.
/// A object whose value is the sum of the values of and .
/// A object.
/// A object that specifies the time interval to add to the object.
/// The resulting value is less than .-or- The resulting value is greater than .
// Token: 0x06003DEC RID: 15852 RVA: 0x000D2468 File Offset: 0x000D0668
public static DateTimeOffset operator +(DateTimeOffset dateTimeTz, TimeSpan timeSpan)
{
return dateTimeTz.Add(timeSpan);
}
/// Determines whether two specified objects represent the same point in time.
/// true if both objects have the same value; otherwise, false.
/// The first object.
/// The second object.
// Token: 0x06003DED RID: 15853 RVA: 0x000D2474 File Offset: 0x000D0674
public static bool operator ==(DateTimeOffset left, DateTimeOffset right)
{
return left.Equals(right);
}
/// Determines whether one specified object is greater than (or later than) a second specified object.
/// true if the value of is later than the value of ; otherwise, false.
/// The first object.
/// The second object.
// Token: 0x06003DEE RID: 15854 RVA: 0x000D2480 File Offset: 0x000D0680
public static bool operator >(DateTimeOffset left, DateTimeOffset right)
{
return left.UtcDateTime > right.UtcDateTime;
}
/// Determines whether one specified object is greater than or equal to a second specified object.
/// true if the value of is the same as or later than the value of ; otherwise, false.
/// The first object.
/// The second object.
// Token: 0x06003DEF RID: 15855 RVA: 0x000D2498 File Offset: 0x000D0698
public static bool operator >=(DateTimeOffset left, DateTimeOffset right)
{
return left.UtcDateTime >= right.UtcDateTime;
}
/// Defines an implicit conversion of a object to a object.
/// A object.
/// A object.
/// The Coordinated Universal Time (UTC) date and time that results from applying the offset is earlier than .-or-The UTC date and time that results from applying the offset is later than .
// Token: 0x06003DF0 RID: 15856 RVA: 0x000D24B0 File Offset: 0x000D06B0
public static implicit operator DateTimeOffset(DateTime dateTime)
{
return new DateTimeOffset(dateTime);
}
/// Determines whether two specified objects refer to different points in time.
/// true if and do not have the same value; otherwise, false.
/// The first object.
/// The second object.
// Token: 0x06003DF1 RID: 15857 RVA: 0x000D24B8 File Offset: 0x000D06B8
public static bool operator !=(DateTimeOffset left, DateTimeOffset right)
{
return left.UtcDateTime != right.UtcDateTime;
}
/// Determines whether one specified object is less than a second specified object.
/// true if the value of is earlier than the value of ; otherwise, false.
/// The first object.
/// The second object.
// Token: 0x06003DF2 RID: 15858 RVA: 0x000D24D0 File Offset: 0x000D06D0
public static bool operator <(DateTimeOffset left, DateTimeOffset right)
{
return left.UtcDateTime < right.UtcDateTime;
}
/// Determines whether one specified object is less than a second specified object.
/// true if the value of is earlier than the value of ; otherwise, false.
/// The first object.
/// The second object.
// Token: 0x06003DF3 RID: 15859 RVA: 0x000D24E8 File Offset: 0x000D06E8
public static bool operator <=(DateTimeOffset left, DateTimeOffset right)
{
return left.UtcDateTime <= right.UtcDateTime;
}
/// Subtracts one object from another and yields a time interval.
/// A object that represents the difference between and .
/// A object (the minuend).
/// A second object (the subtrahend).
// Token: 0x06003DF4 RID: 15860 RVA: 0x000D2500 File Offset: 0x000D0700
public static TimeSpan operator -(DateTimeOffset left, DateTimeOffset right)
{
return left.Subtract(right);
}
/// Subtracts a specified time interval from a specified date and time, and yields a new date and time.
/// A object equal to the value of minus .
/// A object that represents a particular date and time.
/// A time interval.
/// The resulting value is less than or greater than .
// Token: 0x06003DF5 RID: 15861 RVA: 0x000D250C File Offset: 0x000D070C
public static DateTimeOffset operator -(DateTimeOffset dateTimeTz, TimeSpan timeSpan)
{
return dateTimeTz.Subtract(timeSpan);
}
/// Represents the greatest possible value of . This field is read-only.
///
/// is outside the range of the current culture's or specified culture's default calendar.
// Token: 0x040018B6 RID: 6326
public static readonly DateTimeOffset MaxValue = new DateTimeOffset(DateTime.MaxValue, TimeSpan.Zero);
/// Represents the earliest possible value. This field is read-only.
// Token: 0x040018B7 RID: 6327
public static readonly DateTimeOffset MinValue = new DateTimeOffset(DateTime.MinValue, TimeSpan.Zero);
// Token: 0x040018B8 RID: 6328
private DateTime dt;
// Token: 0x040018B9 RID: 6329
private TimeSpan utc_offset;
}
}