Click or drag to resize
Json.NET

JsonConvertToString Method (DateTime, DateFormatHandling, DateTimeZoneHandling)

 
Converts the DateTime to its JSON string representation using the DateFormatHandling specified.

Namespace:  Newtonsoft.Json
Assembly:  Newtonsoft.Json (in Newtonsoft.Json.dll) Version: 12.0.1+509643a8952ce731e0207710c429ad6e67dc43db
Syntax
C#
public static string ToString(
	DateTime value,
	DateFormatHandling format,
	DateTimeZoneHandling timeZoneHandling
)

Parameters

value
Type: SystemDateTime
The value to convert.
format
Type: Newtonsoft.JsonDateFormatHandling
The format the date will be converted to.
timeZoneHandling
Type: Newtonsoft.JsonDateTimeZoneHandling
The time zone handling when the date is converted to a string.

Return Value

Type: String
A JSON string representation of the DateTime.
See Also