Javatpoint Logo
Javatpoint Logo

JavaScript Date toString() method

The JavaScript date toString() method returns a Date object in the form of string.

Syntax

The toString() method is represented by the following syntax:

Return

A string representing the specified date.

JavaScript Date toString() method example

Here, we will understand toString() method through various examples.

Example 1

Let's see an example to print the current date in the form of string.

Test it Now

Output:

Tue Aug 07 2018 16:57:22 GMT+0530 (India Standard Time) 

Example 2

Let's see an example to print the specified date in the form of string.

Test it Now

Output:

Fri Aug 15 1947 20:22:10 GMT+0530 (India Standard Time)
Next TopicJavaScript Date




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA