How to convert the date format to UT in JSON?
How to convert the date format to UT in JSON?
Student
I am Utpal Vishwas from Uttar Pradesh. Have completed my B. Tech. course from MNNIT campus Prayagraj in 2022. I have good knowledge of computer networking.
To 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