Json.NET - Quick Starts & API Documentation
ToString Method (value, format, timeZoneHandling)
Namespaces ► Newtonsoft.Json ► JsonConvert ► ToString(DateTime, DateFormatHandling, DateTimeZoneHandling)
Converts the DateTime to its JSON string representation using the DateFormatHandling specified.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public static string ToString( DateTime value, DateFormatHandling format, DateTimeZoneHandling timeZoneHandling )
Public Shared Function ToString ( _ value As DateTime, _ format As DateFormatHandling, _ timeZoneHandling As DateTimeZoneHandling _ ) As String
public: static String^ ToString( DateTime value, DateFormatHandling format, DateTimeZoneHandling timeZoneHandling )
Parameters
- value (DateTime)
- The value to convert.
- format (DateFormatHandling)
- The format the date will be converted to.
- timeZoneHandling (DateTimeZoneHandling)
- The time zone handling when the date is converted to a string.
Return Value
A JSON string representation of the DateTime.