formatting

Date.prototype.toDateString

Returns the date portion of the Date as a fixed English string, e.g. 'Sun Jul 19 2026'. Companion to toTimeString which returns something like '15:30:00 GMT+0530 (India Standard Time)'.

date.toDateString()

Parameters

Parameter Purpose
() no arguments; English-only, locale-independent
toTimeString() time counterpart with timezone label

Examples

console.log(new Date('2026-07-19T00:00:00Z').toDateString()); // 'Sun Jul 19 2026' (in UTC zone)

no time portion

console.log(new Date('2026-07-19T15:30:00Z').toTimeString()); // '15:30:00 GMT+0000 (Coordinated Universal Time)' style

time + zone

console.log(new Date().toString() === new Date().toDateString() + ' ' + new Date().toTimeString()); // conceptually true

toString ~= date + time

Gotcha

Always English (not localized) and uses local time. For anything user-facing prefer toLocaleDateString or Intl.DateTimeFormat.

Related

← All JS Date methods · Math methods · Cron syntax