getHours

Modified on Tue, 22 Aug 2023

Description

Use this function to get the hours of the given date.

Syntax

getHours(date)

Returns

Return ValueDescription
NumberReturns the hours of the given date.

Sample

ExampleResultDescription
getHours(2023-04-08 13:42:55)13Returns the output as 13.

To view all the Date functions, click here.

See Also