The JavaScript toDateString function returns the date portion of a given date in a human-readable format according to the local time zone.
The syntax of the toDateString function is:
Date.toDateString()
Return Value: The toDateString() does not accept any parameter value and returns the date portion according to the local system time zone. If we use it on an invalid date, it returns Invalid Date as output.
JavaScript toDateString example
In the following example, we use the toDateString function to return the data portion of today’s date.
let dt = new Date();
console.log(dt);
console.log(dt.toDateString());
Tue Jun 16 2026 14:42:10 GMT+0530 (India Standard Time)
Tue Jun 16 2026
TIP: Please use the toTimeString() to extract the time portion or toString() for date and time.
Example 2: In this JavaScript example, we use the Date() constructor to parse a custom string date and use the toDateString() method to return the string date of a custom date in a human-readable format.
let dt = new Date("January 1, 2024 11:12:13");
console.log(dt);
console.log(dt.toDateString());
Mon Jan 01 2024 11:12:13 GMT+0530 (India Standard Time)
Mon Jan 01 2024
Example 3: In this program, we use the Date object to create a date from year, month, day of the month, hour, minute, and second values. Next, apply the toDateString() method to print the date portion in the local system format.
let dt = new Date(2017, 5, 15, 10, 11, 19);
console.log(dt);
console.log(dt.toDateString());
Thu Jun 15 2017 10:11:19 GMT+0530 (India Standard Time)
Thu Jun 15 2017
Example 4: If you pass an invalid date (wrong month or day of the month), the toDateString() method returns an invalid date as output.
let dt = new Date("May 42, 2026");
console.log(dt);
console.log(dt.toDateString());
Invalid Date
Invalid Date
Why does JavaScript toDateString decrements date?
By default, the toDateString() does not decrement the date value. However, it uses the current system’s local time zone to display the date portion. If you reside in New York and the time is midnight, the date falls back to the previous date.
const dt = new Date('2025-06-15');
console.log(dt.toISOString());
console.log(dt);
console.log(dt.toDateString());
2025-06-15T00:00:00.000Z
Sat Jun 14 2025 12:00:00 GMT-1200 (GMT-12:00)
Sat Jun 14 2025