Specifies how TimeSpan and TimeOnly instances are formatted and parsed by the JsonValueExtensions methods.
Namespace: KGySoft.Json
Assembly: KGySoft.Json (in KGySoft.Json.dll) Version: 2.0.1
Syntax
Members
Member name | Value | Description | |
---|---|---|---|
Auto | 0 | When converting to JSON, it is equivalent to the Text format if the target Type is String, or the Milliseconds format if the target Type is Number. When parsing a JsonValue, it represents any defined JsonTimeFormat format. Note: Parsing TimeSpan/TimeOnly values with the Auto option formatted as numeric values (Milliseconds and Ticks) can be ambiguous. Though a "sanity check" is applied for parsing such values use a specific option whenever possible. | |
Milliseconds | 1 | Represents a time in milliseconds. This is conform with the difference of two Date instances in JavaScript. | |
Ticks | 2 | Represents a time in 100 nanoseconds. This is conform with the constructor of the .NET TimeSpan/TimeOnly types and their Ticks property. | |
Text | 3 | Represents a time as a textual value. This is conform with the regular string representation of the TimeSpan/TimeOnly types. |
See Also