How to convert the date format to UT in JSON?
How to convert the date format to UT in JSON?
428
11-May-2023
Updated on 15-May-2023
Aryan Kumar
15-May-2023To convert the date format to UT in JSON, you can use the following steps:
toUTCString()method to convert the date object to a string in UTC format.dateproperty of the JSON object to the string in UTC format.Here is an example of how to convert the date format to UT in JSON:
Code snippet
The
dateproperty of the JSON object will now contain the date in UTC format.Here is an example of how to print the JSON object:
Code snippet
This will print the following output:
Code snippet