DateTimeOffset Methods

The DateTimeOffset type exposes the following members.

  Name Description
Public method Add Returns a new DateTimeOffset object that adds a specified time interval to the value of this instance.
Public method AddDays Returns a new DateTimeOffset object that adds a specified number of whole and fractional days to the value of this instance.
Public method AddHours Returns a new DateTimeOffset object that adds a specified number of whole and fractional hours to the value of this instance.
Public method AddMilliseconds Returns a new DateTimeOffset object that adds a specified number of milliseconds to the value of this instance.
Public method AddMinutes Returns a new DateTimeOffset object that adds a specified number of whole and fractional minutes to the value of this instance.
Public method AddMonths Returns a new DateTimeOffset object that adds a specified number of months to the value of this instance.
Public method AddSeconds Returns a new DateTimeOffset object that adds a specified number of whole and fractional seconds to the value of this instance.
Public method AddTicks Returns a new DateTimeOffset object that adds a specified number of ticks to the value of this instance.
Public method AddYears Returns a new DateTimeOffset object that adds a specified number of years to the value of this instance.
Public method Static member Compare Compares two DateTimeOffset objects and indicates whether the first is earlier than the second, equal to the second, or later than the second.
Public method CompareTo 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.
Public method Equals(DateTimeOffset) Determines whether the current DateTimeOffset object represents the same point in time as a specified DateTimeOffset object.
Public method Equals(Object) Determines whether a DateTimeOffset object represents the same point in time as a specified object. (Overrides ValueType.Equals(Object).)
Public method Static member Equals(DateTimeOffset, DateTimeOffset) Determines whether two specified DateTimeOffset objects represent the same point in time.
Public method EqualsExact Determines whether the current DateTimeOffset object represents the same time and has the same offset as a specified DateTimeOffset object.
Public method Static member FromFileTime Converts the specified Windows file time to an equivalent local time.
Public method GetHashCode Returns the hash code for the current DateTimeOffset object. (Overrides ValueType.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Static member Parse(String) Converts the specified string representation of a date, time, and offset to its DateTimeOffset equivalent.
Public method Static member Parse(String, IFormatProvider) Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified culture-specific format information.
Public method Static member Parse(String, IFormatProvider, DateTimeStyles) Converts the specified string representation of a date and time to its DateTimeOffset equivalent using the specified culture-specific format information and formatting style.
Public method Static member ParseExact(String, String, IFormatProvider) 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.
Public method Static member ParseExact(String, String, IFormatProvider, DateTimeStyles) 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.
Public method Static member ParseExact(String, String[], IFormatProvider, DateTimeStyles) 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.
Public method Subtract(DateTimeOffset) Subtracts a DateTimeOffset value that represents a specific date and time from the current DateTimeOffset object.
Public method Subtract(TimeSpan) Subtracts a specified time interval from the current DateTimeOffset object.
Public method ToFileTime Converts the value of the current DateTimeOffset object to a Windows file time.
Public method ToLocalTime Converts the current DateTimeOffset object to a DateTimeOffset object that represents the local time.
Public method ToOffset Converts the value of the current DateTimeOffset object to the date and time specified by an offset value.
Public method ToString() Converts the value of the current DateTimeOffset object to its equivalent string representation. (Overrides ValueType.ToString().)
Public method ToString(IFormatProvider) Converts the value of the current DateTimeOffset object to its equivalent string representation using the specified culture-specific formatting information.
Public method ToString(String) Converts the value of the current DateTimeOffset object to its equivalent string representation using the specified format.
Public method ToString(String, IFormatProvider) Converts the value of the current DateTimeOffset object to its equivalent string representation using the specified format and culture-specific format information.
Public method ToUniversalTime Converts the current DateTimeOffset object to a DateTimeOffset value that represents the Coordinated Universal Time (UTC).
Public method Static member TryParse(String, DateTimeOffset) Tries to converts a specified string representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded.
Public method Static member TryParse(String, IFormatProvider, DateTimeStyles, DateTimeOffset) Tries to convert a specified string representation of a date and time to its DateTimeOffset equivalent, and returns a value that indicates whether the conversion succeeded.
Public method Static member TryParseExact(String, String, IFormatProvider, 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.
Public method Static member TryParseExact(String, String[], IFormatProvider, DateTimeStyles, DateTimeOffset) Converts the specified string representation of a date and time to its DateTimeOffset 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.
Top

  Name Description
Explicit interface implemetation Private method IComparable.CompareTo Infrastructure. Compares the value of the current DateTimeOffset object with another object of the same type.
Explicit interface implemetation Private method IDeserializationCallback.OnDeserialization Infrastructure. Runs when the deserialization of an object has been completed.
Explicit interface implemetation Private method ISerializable.GetObjectData Infrastructure. Populates a SerializationInfo object with the data required to serialize the current DateTimeOffset object.
Top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft