JavaScript Date toTimeString() methodThe JavaScript date toTimeString() method returns the time portion of a Date object in the form of string. SyntaxThe toTimeString() method is represented by the following syntax: ReturnA string representing the time portion of a Date object. JavaScript Date toTimeString() method exampleHere, we will understand toTimeString() method through various examples. Example 1Let's see an example to fetch current time in the form of string. Test it NowOutput: 10:19:29 GMT+0530 (India Standard Time) Example 2Let's see an example to fetch time portion only from the specified Date object. Test it NowOutput: 20:22:10 GMT+0530 (India Standard Time) Example 3Let's see one more example to fetch time portion only from the specified Date object. Test it NowOutput: 20:22:10 GMT+0530 (India Standard Time) Next TopicJavaScript Date |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India