JavaScript - Convert A Date Object To A String

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)
4const dateToString = JSON.stringify(today)
5// ""2019-01-10T00:00:00.000Z""
Previous post:
Babel - RegeneratorRuntime Is Not Defined
Next post:
JavaScript - Combine Data From Two Arrays