TomlDateTimeSyntax Class

A date, a time, or both. Which one is the node's kind.

public sealed class TomlDateTimeSyntax : TomlValueSyntax

Remarks

KindExample, and the type of TomlDateTimeSyntax.Value
SyntaxKind.TomlOffsetDateTime1979-05-27T07:32:00Z, a DateTimeOffset
SyntaxKind.TomlLocalDateTime1979-05-27T07:32:00, a DateTime of kind DateTimeKind.Unspecified
SyntaxKind.TomlLocalDate1979-05-27, a DateOnly
SyntaxKind.TomlLocalTime07: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
TomlValueSyntax TomlDateTimeSyntax

Properties

NameDescription
DateTimeToken
ValueGets the value: a DateTimeOffset, DateTime, DateOnly, or TimeOnly, depending on the kind.
public SyntaxToken DateTimeToken { get; }

Property value

SyntaxToken

No documentation is available.

Gets the value: a DateTimeOffset, DateTime, DateOnly, or TimeOnly, depending on the kind.

public object Value { get; }

Property value

object

Exceptions

InvalidOperationException
The token was built by hand and does not spell a date or a time.

Methods

NameDescription
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.cs
public override void Accept(TomlSyntaxVisitor visitor)
Parameters
visitor TomlSyntaxVisitor

No documentation is available.

Accept<TResult>(TomlSyntaxVisitor<TResult>)

TomlDateTimeSyntax.cs
public override TResult? Accept<TResult>(TomlSyntaxVisitor<TResult> visitor)
Type parameters
TResult
Parameters
visitor TomlSyntaxVisitor<TResult>
Returns

TResult?

No documentation is available.

Update(SyntaxToken)

TomlDateTimeSyntax.cs

Returns this value with a different token, or itself when nothing changed.

public TomlDateTimeSyntax Update(SyntaxToken dateTimeToken)

Parameters

dateTimeToken SyntaxToken

Returns

TomlDateTimeSyntax

Remarks

The kind of the node follows the token, so replacing a date with a time changes both.

WithDateTimeToken(SyntaxToken)

TomlDateTimeSyntax.cs
public TomlDateTimeSyntax WithDateTimeToken(SyntaxToken dateTimeToken)

Parameters

dateTimeToken SyntaxToken

Returns

TomlDateTimeSyntax

No documentation is available.