The JavaScript date toString() method is used to get the date in the form of string.
Syntax:
dateObj.toString();
Return:
String representation of date portion of a Date object.
Example:
<!DOCTYPE html> <html> <body> <script> var bday=new Date("November 16, 1994 21:10:10"); document.writeln(bday.toString()); </script> </body> </html> |
Output:
Wed Nov 16 1994 21:10:10 GMT+0530 (IST) |
Please Share