JavaScript - Convert A Date Object To A String
10th January 2019
2 min read
How To Convert A JS Date Object To A String
JSON.stringify
can be used to convert a date object to a string. Example:
1const today = const today = new Date()2// Thu Jan 10 2019 00:00:00 GMT+0000 (Greenwich Mean Time)34const dateToString = JSON.stringify(today)5// ""2019-01-10T00:00:00.000Z""
Previous post:
Babel - RegeneratorRuntime Is Not Defined
Discussion