System.DateTimeOffset Members

The members of System.DateTimeOffset are listed below.

See Also: Inherited members from System.ValueType

Public Constructors

Initializes a new instance of the DateTimeOffset structure using the specified DateTime value.

Initializes a new instance of the DateTimeOffset structure using the specified DateTime value and offset.

Initializes a new instance of the DateTimeOffset structure using the specified number of ticks and offset.

Initializes a new instance of the DateTimeOffset structure using the specified year, month, day, hour, minute, second, and offset.

Initializes a new instance of the DateTimeOffset structure using the specified year, month, day, hour, minute, second, millisecond, and offset.

Initializes a new instance of the DateTimeOffset structure using the specified year, month, day, hour, minute, second, millisecond, and offset of a specified calendar.

Public Fields

static readonly
MaxValueDateTimeOffset (12/31/9999 11:59:59 PM +00:00).

Represents the greatest possible value of DateTimeOffset. This field is read-only.

static readonly
MinValueDateTimeOffset (1/1/0001 12:00:00 AM +00:00).

Represents the earliest possible DateTimeOffset value. This field is read-only.

Public Properties

[read-only]
DateDateTime.

Gets a DateTime value that represents the date component of the current DateTimeOffset object.

[read-only]
DateTimeDateTime.

Gets a DateTime value that represents the date and time of the current DateTimeOffset object.

[read-only]
Dayint.

Gets the day of the month represented by the current DateTimeOffset object.

[read-only]
DayOfWeekDayOfWeek.

Gets the day of the week represented by the current DateTimeOffset object.

[read-only]
DayOfYearint.

Gets the day of the year represented by the current DateTimeOffset object.

[read-only]
Hourint.

Gets the hour component of the time represented by the current DateTimeOffset object.

[read-only]
LocalDateTimeDateTime.

Gets a DateTime value that represents the local date and time of the current DateTimeOffset object.

[read-only]
Millisecondint.

Gets the millisecond component of the time represented by the current DateTimeOffset object.

[read-only]
Minuteint.

Gets the minute component of the time represented by the current DateTimeOffset object.

[read-only]
Monthint.

Gets the month component of the date represented by the current DateTimeOffset object.

[read-only]
static
NowDateTimeOffset.

Gets a DateTimeOffset 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).

[read-only]
OffsetTimeSpan.

Gets the time's offset from Coordinated Universal Time (UTC).

[read-only]
Secondint.

Gets the second component of the clock time represented by the current DateTimeOffset object.

[read-only]
Tickslong.

Gets the number of ticks that represents the date and time of the current DateTimeOffset object in clock time.

[read-only]
TimeOfDayTimeSpan.

Gets the time of day for the current DateTimeOffset object.

[read-only]
UtcDateTimeDateTime.

Gets a DateTime value that represents the Coordinated Universal Time (UTC) date and time of the current DateTimeOffset object.

[read-only]
static
UtcNowDateTimeOffset.

Gets a DateTimeOffset object whose date and time are set to the current Coordinated Universal Time (UTC) date and time and whose offset is TimeSpan.Zero.

[read-only]
UtcTickslong.

Gets the number of ticks that represents the date and time of the current DateTimeOffset object in Coordinated Universal Time (UTC).

[read-only]
Yearint.

Gets the year component of the date represented by the current DateTimeOffset object.

Public Methods

Add(TimeSpan) : DateTimeOffset

Adds a specified time interval to a DateTimeOffset object.

AddDays(double) : DateTimeOffset

Adds a specified number of whole and fractional days to the current DateTimeOffset object.

AddHours(double) : DateTimeOffset

Adds a specified number of whole and fractional hours to the current DateTimeOffset object.

AddMilliseconds(double) : DateTimeOffset

Adds a specified number of milliseconds to the current DateTimeOffset object.

AddMinutes(double) : DateTimeOffset

Adds a specified number of whole and fractional minutes to the current DateTimeOffset object.

AddMonths(int) : DateTimeOffset

Adds a specified number of months to the current DateTimeOffset object.

AddSeconds(double) : DateTimeOffset

Adds a specified number of whole and fractional seconds to the current DateTimeOffset object.

AddTicks(long) : DateTimeOffset

Adds a specified number of ticks to the current DateTimeOffset object.

AddYears(int) : DateTimeOffset

Adds a specified number of years to the DateTimeOffset object.

static
Compare(DateTimeOffset, DateTimeOffset) : int

Compares two DateTimeOffset objects and indicates whether the first is earlier than the second, equal to the second, or later than the second.

CompareTo(DateTimeOffset) : int

Compares the current DateTimeOffset object to a specified DateTimeOffset object and indicates whether the current object is earlier than, the same as, or later than the second DateTimeOffset object.

Equals(DateTimeOffset) : bool

Determines whether the current DateTimeOffset object represents the same point in time as a specified DateTimeOffset object.

override
Equals(object) : bool

Determines whether a DateTimeOffset object represents the same point in time as a specified object.

static
Equals(DateTimeOffset, DateTimeOffset) : bool

Determines whether two specified DateTimeOffset objects represent the same point in time.

EqualsExact(DateTimeOffset) : bool

Determines whether the current DateTimeOffset object represents the same time and has the same offset as a specified DateTimeOffset object.

static
FromFileTime(long) : DateTimeOffset

Converts the specified Windows file time to an equivalent local time.

override
GetHashCode() : int

Returns the hash code for the current DateTimeOffset object.

static
Parse(string) : DateTimeOffset

Converts the specified string representation of a date, time, and offset to its DateTimeOffset equivalent.

static
Parse(string, IFormatProvider) : DateTimeOffset

Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified culture-specific format information.

static
Parse(string, IFormatProvider, System.Globalization.DateTimeStyles) : DateTimeOffset

Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified culture-specific format information and formatting style.

static
ParseExact(string, string, IFormatProvider) : DateTimeOffset

Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

static
ParseExact(string, string, IFormatProvider, System.Globalization.DateTimeStyles) : DateTimeOffset

Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly.

static
ParseExact(string, string[], IFormatProvider, System.Globalization.DateTimeStyles) : DateTimeOffset

Converts the specified string representation of a date and time to its DateTimeOffset 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.

Subtract(DateTimeOffset) : TimeSpan

Subtracts a DateTimeOffset value that represents a specific date and time from the current DateTimeOffset object.

Subtract(TimeSpan) : DateTimeOffset

Subtracts a specified time interval from the current DateTimeOffset object.

ToFileTime() : long

Converts the value of the current DateTimeOffset object to a Windows file time.

ToLocalTime() : DateTimeOffset

Converts the current DateTimeOffset object to a DateTimeOffset object that represents the local time.

ToOffset(TimeSpan) : DateTimeOffset

Converts the value of the current DateTimeOffset object to the date and time specified by an offset value.

override
ToString() : string

Converts the value of the current DateTimeOffset object to its equivalent string representation.

ToString(IFormatProvider) : string

Converts the value of the current DateTimeOffset object to its equivalent string representation using the specified culture-specific formatting information.

ToString(string) : string

Converts the value of the current DateTimeOffset object to its equivalent string representation using the specified format.

ToString(string, IFormatProvider) : string

Converts the value of the current DateTimeOffset object to its equivalent string representation using the specified format and culture-specific format information.

ToUniversalTime() : DateTimeOffset

Converts the current DateTimeOffset object to a DateTimeOffset value that represents the Coordinated Universal Time (UTC).

static
TryParse(string, out DateTimeOffset) : bool
Documentation for this section has not yet been entered.
static
TryParse(string, IFormatProvider, System.Globalization.DateTimeStyles, out DateTimeOffset) : bool
Documentation for this section has not yet been entered.
static
TryParseExact(string, string, IFormatProvider, System.Globalization.DateTimeStyles, out DateTimeOffset) : bool
Documentation for this section has not yet been entered.
static
TryParseExact(string, string[], IFormatProvider, System.Globalization.DateTimeStyles, out DateTimeOffset) : bool
Documentation for this section has not yet been entered.

Public Operators

static
Addition(DateTimeOffset, TimeSpan)

Adds a specified time interval to a DateTimeOffset object that has a specified date and time, and yields a DateTimeOffset object that has new a date and time.

static
Equality(DateTimeOffset, DateTimeOffset)

Determines whether two specified DateTimeOffset objects represent the same point in time.

static
GreaterThan(DateTimeOffset, DateTimeOffset)

Determines whether one specified DateTimeOffset object is greater than (or later than) a second specified DateTimeOffset object.

static
GreaterThanOrEqual(DateTimeOffset, DateTimeOffset)

Determines whether one specified DateTimeOffset object is greater than or equal to a second specified DateTimeOffset object.

static
Inequality(DateTimeOffset, DateTimeOffset)

Determines whether two specified DateTimeOffset objects refer to different points in time.

static
LessThan(DateTimeOffset, DateTimeOffset)

Determines whether one specified DateTimeOffset object is less than a second specified DateTimeOffset object.

static
LessThanOrEqual(DateTimeOffset, DateTimeOffset)

Determines whether one specified DateTimeOffset object is less than a second specified DateTimeOffset object.

static
Subtraction(DateTimeOffset, DateTimeOffset)

Subtracts one DateTimeOffset object from another and yields a time interval.

static
Subtraction(DateTimeOffset, TimeSpan)

Subtracts a specified time interval from a specified date and time, and yields a new date and time.

static
Conversion to System.DateTimeOffset(Implicit)Documentation for this section has not yet been entered.

Explicitly Implemented Interface Members

IComparable.CompareTo

Compares the value of the current DateTimeOffset object with another object of the same type.

System.Runtime.Serialization.ISerializable.GetObjectData

Populates a System.Runtime.Serialization.SerializationInfo object with the data required to serialize the current DateTimeOffset object.

System.Runtime.Serialization.IDeserializationCallback.OnDeserialization

Runs when the deserialization of an object has been completed.