Date.toString()
Converts a Date object to a string
Last updated
Converts a Date object to a string
Last updated
The toString() method returns a string representing the specified Date object.
Return value
A string representing the given date.
The object overrides the toString()
method of the object; it does not inherit . For objects, the toString()
method returns a string representation of the object.
The toString()
method always returns a string representation of the date in American English.
JavaScript calls the toString()
method automatically when a date is to be represented as a text value or when a date is referred to in a string concatenation.
toString()
is a generic method. If this
is not a instance, it returns "Invalid Date".
toString()
Uros Durdevic
The following assigns the toString()
value of a object to myVar
: