Utf8jsonreader Datetimeoffset Rfc 3339 -
The RFC 3339 format for dates and times is as follows:
// Convert to chars (stack allocation preferred if small) Span<char> charBuffer = stackalloc char[source.Length]; int charsWritten = System.Text.Encoding.UTF8.GetChars(source, charBuffer); utf8jsonreader datetimeoffset rfc 3339
// Parse the char span if (DateTimeOffset.TryParse(charSpan, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out var dto)) The RFC 3339 format for dates and times
The most efficient approach currently involves converting the span slice to chars or relying on the internal logic of GetDateTimeOffset() (which is highly optimized). charBuffer = stackalloc char[source.Length]