Class UnixDateTimeConverter
Converts a DateTime to and from a Unix timestamp (seconds since the Unix Epoch).
Inheritance
object
JsonConverter
JsonConverter<DateTime?>
UnixDateTimeConverter
Namespace: Xrpl.Client.Json.Converters
Assembly: Xrpl.dll
Syntax
public class UnixDateTimeConverter : JsonConverter<DateTime?>
Methods
| Edit this page View SourceRead(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type System.Nullable.
Declaration
public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | The reader. |
| Type | typeToConvert | The type to convert. |
| JsonSerializerOptions | options | An object that specifies serialization options to use. |
Returns
| Type | Description |
|---|---|
| Nullable | The converted value. |
Overrides
System.Text.Json.Serialization.JsonConverter<System.DateTime?>.Read(ref System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)
|
Edit this page
View Source
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 |
|---|---|---|
| Utf8JsonWriter | writer | The writer to write to. |
| Nullable | value | The value to convert to 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)