Show / Hide Table of Contents

Class JsonEpochSecondsDateTimeConverter

The JsonEpochSecondsDateTimeConverter converts DateTime to/from JSON number using epoch seconds.

Inheritance
System.Object
System.Text.Json.Serialization.JsonConverter
System.Text.Json.Serialization.JsonConverter<System.DateTime>
JsonEpochSecondsDateTimeConverter
Namespace: LambdaSharp.Serialization
Assembly: LambdaSharp.dll
Syntax
public class JsonEpochSecondsDateTimeConverter : JsonConverter<DateTime>

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts JSON to the appropriate type.

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

The reader.

System.Type typeToConvert

The type to convert.

System.Text.Json.JsonSerializerOptions options

An object that specifies serialization options to use.

Returns
Type Description
System.DateTime
Overrides
System.Text.Json.Serialization.JsonConverter<System.DateTime>.Read(System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)

Write(Utf8JsonWriter, DateTime, JsonSerializerOptions)

Writes a specified value as JSON.

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

The writer to write to.

System.DateTime value

The value to convert to JSON.

System.Text.Json.JsonSerializerOptions options

An object that specifies serialization options to use.

Overrides
System.Text.Json.Serialization.JsonConverter<System.DateTime>.Write(System.Text.Json.Utf8JsonWriter, System.DateTime, System.Text.Json.JsonSerializerOptions)
In This Article
Back to top Generated by DocFX