Method 2:Using String Constructor

The String constructor property in JavaScript is used to return the string constructor function for the object.

Example: In this example, we will convert the date object to a string using the String constructor.

Javascript
// New date using date Constructor
let d =  new Date()

// Convert to string
let dateString = String(d);

// Print output
console.log(dateString)

Output
Wed Sep 20 2023 08:42:52 GMT+0000 (Coordinated Universal Time)

JavaScript Program to Convert Date to String

In this article, we will see how to convert a JavaScript Date to a string using JavaScript. We have a few methods to convert JavaScript Date to string which are described below.

Similar Reads

Methods to Convert Date to String in JavaScript

Table of Content Using the Date.toString() methodUsing String ConstructorUsing the Date.toDateString() methodUsing Date.toLocaleString() methodUsing Date.toGMTString() methodUsing Date.toISOString() method...

Method 1: Using the Date.toString() method

JavaScript date.toString() method is used to convert the given Date object’s contents into a string....

Method 2:Using String Constructor

The String constructor property in JavaScript is used to return the string constructor function for the object....

Method 3: Using the Date.toDateString() method

The date.toDateString() method converts the given date object’s contents of the date portion into a string....

Method 4: Using Date.toLocaleString() method

The date.toLocaleString() method is used to convert a date and time to a string using the locale settings. The default settings for GMT....

Method 5: Using Date.toGMTString() method

The date.toGMTString() method is used to convert the given date object’s contents into a string according to the Greenwich Mean Time GMT....

Method 6: Using Date.toISOString() method

The toISOString() method in JavaScript converts a Date object to a string in ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ). This format is widely accepted and used for representing dates and times....