TomlDateTime Struct
A datetime value that can represent a TOML - An offset DateTime with Zero offset or Number offset. - A local DateTime. - A local Date. - A local Time.
public struct TomlDateTime : IConvertible, IEquatable<TomlDateTime>- Implements
Constructors
| Name | Description |
|---|---|
| TomlDateTime(DateTime) | Initializes a local-date-time TOML value from a TomlDateTime.DateTime. |
| TomlDateTime(DateTimeOffset, int, TomlDateTimeKind) | A datetime value that can represent a TOML - An offset DateTime with Zero offset or Number offset. - A local DateTime. - A local Date. - A local Time. |
| TomlDateTime(int, int, int) | Initializes a local-date TOML value from a date component. |
TomlDateTime overloads
TomlDateTime(DateTime)
TomlDateTime.csInitializes a local-date-time TOML value from a TomlDateTime.DateTime.
public TomlDateTime(DateTime datetime)Parameters
datetimeDateTime- The date/time value. Its wall-clock value is used, whatever its
DateTime.Kind, and its fractional seconds are kept.
TomlDateTime(DateTimeOffset, int, TomlDateTimeKind)
A datetime value that can represent a TOML - An offset DateTime with Zero offset or Number offset. - A local DateTime. - A local Date. - A local Time.
public TomlDateTime(DateTimeOffset DateTime, int SecondPrecision, TomlDateTimeKind Kind)Parameters
DateTimeDateTimeOffset- The datetime offset.
SecondPrecisionint- The precision of milliseconds.
KindTomlDateTimeKind- The kind of datetime offset.
TomlDateTime(int, int, int)
TomlDateTime.csProperties
| Name | Description |
|---|---|
| DateTime | The datetime offset. |
| Kind | The kind of datetime offset. |
| SecondPrecision | The precision of milliseconds. |
DateTime
TomlDateTime.csKind
TomlDateTime.csSecondPrecision
TomlDateTime.csMethods
Deconstruct(DateTimeOffset, int, TomlDateTimeKind)
public readonly void Deconstruct(out DateTimeOffset DateTime, out int SecondPrecision, out TomlDateTimeKind Kind)Parameters
DateTimeDateTimeOffsetSecondPrecisionintKindTomlDateTimeKind
No documentation is available.
Equals overloads
Equals(TomlDateTime)
TomlDateTime.csIndicates whether two values are the same TOML value: the same TomlDateTime.Kind and the same instant for offset date-times, or the same date, time, or both for local values.
public readonly bool Equals(TomlDateTime other)Parameters
otherTomlDateTime
Returns
Remarks
TomlDateTime.SecondPrecision only affects how the value is written, so 07:32:00.5 equals 07:32:00.50. A local value has no offset: the offset of TomlDateTime.DateTime is ignored, and so is the time of a local date and the date of a local time.
Equals(object)
GetFormatPrecision(int)
TomlDateTime.csGetHashCode()
TomlDateTime.csSystem.IConvertible.GetTypeCode()
TomlDateTime.csSystem.IConvertible.ToBoolean(IFormatProvider?)
TomlDateTime.csbool IConvertible.ToBoolean(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToByte(IFormatProvider?)
TomlDateTime.csbyte IConvertible.ToByte(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToChar(IFormatProvider?)
TomlDateTime.cschar IConvertible.ToChar(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToDateTime(IFormatProvider?)
TomlDateTime.csDateTime IConvertible.ToDateTime(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToDecimal(IFormatProvider?)
TomlDateTime.csdecimal IConvertible.ToDecimal(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToDouble(IFormatProvider?)
TomlDateTime.csdouble IConvertible.ToDouble(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToInt16(IFormatProvider?)
TomlDateTime.csshort IConvertible.ToInt16(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToInt32(IFormatProvider?)
TomlDateTime.csint IConvertible.ToInt32(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToInt64(IFormatProvider?)
TomlDateTime.cslong IConvertible.ToInt64(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToSByte(IFormatProvider?)
TomlDateTime.cssbyte IConvertible.ToSByte(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToSingle(IFormatProvider?)
TomlDateTime.csfloat IConvertible.ToSingle(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToString(IFormatProvider?)
TomlDateTime.csstring IConvertible.ToString(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToType(Type, IFormatProvider?)
TomlDateTime.csobject IConvertible.ToType(Type conversionType, IFormatProvider? provider)No documentation is available.
System.IConvertible.ToUInt16(IFormatProvider?)
TomlDateTime.csushort IConvertible.ToUInt16(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToUInt32(IFormatProvider?)
TomlDateTime.csuint IConvertible.ToUInt32(IFormatProvider? provider)No documentation is available.
System.IConvertible.ToUInt64(IFormatProvider?)
TomlDateTime.csulong IConvertible.ToUInt64(IFormatProvider? provider)No documentation is available.
ToString()
TomlDateTime.csOperators
| Name | Description |
|---|---|
| operator ==(TomlDateTime, TomlDateTime) | |
| implicit operator TomlDateTime(DateTime) | Converts a datetime to TomlDateTime, the way the serializer writes it. |
| operator !=(TomlDateTime, TomlDateTime) |
operator ==(TomlDateTime, TomlDateTime)
public static bool operator ==(TomlDateTime left, TomlDateTime right)No documentation is available.
implicit operator TomlDateTime(DateTime)
TomlDateTime.csConverts a datetime to TomlDateTime, the way the serializer writes it.
public static implicit operator TomlDateTime(DateTime dateTime)Parameters
dateTimeDateTime
Returns
Exceptions
TomlException- A local value near
DateTime.MinValueorDateTime.MaxValueis out of range once converted to UTC.
Remarks
A DateTimeKind.Utc value is an offset date-time with Z, a DateTimeKind.Local value an offset date-time with the offset of the machine, and an DateTimeKind.Unspecified value a local date-time. The fractional seconds are kept.
operator !=(TomlDateTime, TomlDateTime)
public static bool operator !=(TomlDateTime left, TomlDateTime right)No documentation is available.