• JavaScript Video Tutorials

JavaScript Date - toTimeString Method



Description

This method returns the time portion of a Date object in human readable form.

Syntax

Its syntax is as follows −

Date.toTimeString ()

Return Value

Returns the time portion of a Date object in human readable form.

Example

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>

Output

14:39:07 GMT+0530 (India Standard Time)
javascript_date_object.htm
Advertisements