JsonValueExtensionsToJson(DateTimeOffset, JsonDateTimeFormat, Boolean) Method
Namespace: KGySoft.JsonAssembly: KGySoft.Json (in KGySoft.Json.dll) Version: 3.0.0
public static JsonValue ToJson(
this DateTimeOffset value,
JsonDateTimeFormat format = JsonDateTimeFormat.Auto,
bool asString = true
)
<ExtensionAttribute>
Public Shared Function ToJson (
value As DateTimeOffset,
Optional format As JsonDateTimeFormat = JsonDateTimeFormat.Auto,
Optional asString As Boolean = true
) As JsonValue
public:
[ExtensionAttribute]
static JsonValue ToJson(
DateTimeOffset value,
JsonDateTimeFormat format = JsonDateTimeFormat::Auto,
bool asString = true
)
[<ExtensionAttribute>]
static member ToJson :
value : DateTimeOffset *
?format : JsonDateTimeFormat *
?asString : bool
(* Defaults:
let _format = defaultArg format JsonDateTimeFormat.Auto
let _asString = defaultArg asString true
*)
-> JsonValue
- value DateTimeOffset
- The value to convert.
- format JsonDateTimeFormat (Optional)
- Specifies the format of the value as a JSON value. This parameter is optional.
Default value: Auto, which applies Iso8601JavaScript if asString is ,
or UnixMilliseconds if asString is . - asString Boolean (Optional)
- to convert the value to a JsonValue
with String Type; or to convert it to a JsonValue
with Number Type, which is not applicable for all formats. This parameter is optional.
Default value: .
JsonValueA
JsonValue instance that is the JSON representation of the specified
value.In Visual Basic and C#, you can call this method as an instance method on any object of type
DateTimeOffset. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).