TomlDateTimeSyntax Class
A date, a time, or both. Which one is the node's kind.
public sealed class TomlDateTimeSyntax : TomlValueSyntaxRemarks
| Kind | Example, and the type of TomlDateTimeSyntax.Value |
|---|---|
SyntaxKind.TomlOffsetDateTime | 1979-05-27T07:32:00Z, a DateTimeOffset |
SyntaxKind.TomlLocalDateTime | 1979-05-27T07:32:00, a DateTime of kind DateTimeKind.Unspecified |
SyntaxKind.TomlLocalDate | 1979-05-27, a DateOnly |
SyntaxKind.TomlLocalTime | 07:32:00, a TimeOnly |
Digits past the seventh of a fraction of a second are truncated, as the specification asks. An offset further from UTC than .NET allows (±14:00) gives the same instant with an offset of zero.
- Inheritance
TomlValueSyntaxTomlDateTimeSyntax
Properties
| Name | Description |
|---|---|
| DateTimeToken | |
| Value | Gets the value: a DateTimeOffset, DateTime, DateOnly, or TimeOnly, depending on the kind. |
DateTimeToken
TomlDateTimeSyntax.csGets the value: a DateTimeOffset, DateTime, DateOnly, or TimeOnly, depending on the kind.
public object Value { get; }Property value
Exceptions
InvalidOperationException- The token was built by hand and does not spell a date or a time.
Methods
| Name | Description |
|---|---|
| Accept(TomlSyntaxVisitor) | |
| Accept<TResult>(TomlSyntaxVisitor<TResult>) | |
| Update(SyntaxToken) | Returns this value with a different token, or itself when nothing changed. |
| WithDateTimeToken(SyntaxToken) |
Accept overloads
Accept(TomlSyntaxVisitor)
TomlDateTimeSyntax.cspublic override void Accept(TomlSyntaxVisitor visitor)Parameters
visitorTomlSyntaxVisitor
No documentation is available.
Accept<TResult>(TomlSyntaxVisitor<TResult>)
TomlDateTimeSyntax.cspublic override TResult? Accept<TResult>(TomlSyntaxVisitor<TResult> visitor)No documentation is available.
Update(SyntaxToken)
TomlDateTimeSyntax.csReturns this value with a different token, or itself when nothing changed.
public TomlDateTimeSyntax Update(SyntaxToken dateTimeToken)Parameters
dateTimeTokenSyntaxToken
Returns
Remarks
The kind of the node follows the token, so replacing a date with a time changes both.
WithDateTimeToken(SyntaxToken)
TomlDateTimeSyntax.cspublic TomlDateTimeSyntax WithDateTimeToken(SyntaxToken dateTimeToken)No documentation is available.