Date.toDateString()
Converts the date portion of a Date object into a readable string
Last updated
Converts the date portion of a Date object into a readable string
Last updated
The toDateString() method returns the date portion of a Date object in human readable form in American English.
Return value
A string representing the date portion of the given object in human readable form in American English.
instances refer to a specific point in time. Calling will return the date formatted in a human readable form in American English. In , this consists of the date portion (day, month, and year) followed by the time portion (hours, minutes, seconds, and time zone). Sometimes it is desirable to obtain a string of the time portion; such a thing can be accomplished with the toTimeString()
method.
The toDateString()
method is especially useful because compliant engines implementing may differ in the string obtained from for objects, as the format is implementation-dependent and simple string slicing approaches may not produce consistent results across multiple engines.
toDateString()
Uros Durdevic