This method returns the time portion of a Date object in human readable form.
Its syntax is as follows −
Date.toTimeString ()
Returns the time portion of a Date object in human readable form.
Try the following example.
<html> <head> <title>JavaScript toTimeString Method</title> </head> <body> <script type="text/javascript"> var dateobject = new Date(1993, 6, 28, 14, 39, 7); document.write( dateobject.toTimeString() ); </script> </body> </html>
14:39:07 GMT+0530 (India Standard Time)