JavaScript Date toString() methodThe JavaScript date toString() method returns a Date object in the form of string. SyntaxThe toString() method is represented by the following syntax: ReturnA string representing the specified date. JavaScript Date toString() method exampleHere, we will understand toString() method through various examples. Example 1Let's see an example to print the current date in the form of string. Test it NowOutput: Tue Aug 07 2018 16:57:22 GMT+0530 (India Standard Time) Example 2Let's see an example to print the specified date in the form of string. Test it NowOutput: Fri Aug 15 1947 20:22:10 GMT+0530 (India Standard Time)
Next TopicJavaScript Date
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week