Show / Hide Table of Contents

Class CustomDateTimeConverterUtil

Inheritance
object
JsonConverter
JsonConverter<DateTime>
CustomDateTimeConverterUtil
Inherited Members
JsonConverter<DateTime>.CanConvert(Type)
JsonConverter<DateTime>.ReadAsPropertyName(ref Utf8JsonReader, Type, JsonSerializerOptions)
JsonConverter<DateTime>.WriteAsPropertyName(Utf8JsonWriter, DateTime, JsonSerializerOptions)
JsonConverter<DateTime>.HandleNull
JsonConverter<DateTime>.Type
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: EasySave_Project.Util
Assembly: .dll
Syntax
public class CustomDateTimeConverterUtil : JsonConverter<DateTime>

Methods

| Edit this page View Source

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts a JSON string to a DateTime object.

Declaration
public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
Type Name Description
Utf8JsonReader reader

The Utf8JsonReader to read from.

Type typeToConvert

The target type (should be DateTime).

JsonSerializerOptions options

Serialization options.

Returns
Type Description
DateTime

The parsed DateTime object.

Overrides
JsonConverter<DateTime>.Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Exceptions
Type Condition
JsonException

Thrown if parsing fails.

| Edit this page View Source

Write(Utf8JsonWriter, DateTime, JsonSerializerOptions)

Writes a DateTime object as a JSON string using the specified format.

Declaration
public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options)
Parameters
Type Name Description
Utf8JsonWriter writer

The Utf8JsonWriter to write to.

DateTime value

The DateTime value to serialize.

JsonSerializerOptions options

Serialization options.

Overrides
JsonConverter<DateTime>.Write(Utf8JsonWriter, DateTime, JsonSerializerOptions)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX