extract
Returns an integer representing the value of "date_part_expression" in "datetime_expression". "Date_part_expression" could be the year, month, day, hour, minute, or second.
Syntax
extract ( date_part_expression , datetime_expression )
Example 1
extract ( year , 2003-03-03 16:40:15.535 )
Result
2003
Example 2
extract ( hour , 2003-03-03 16:40:15.535 )
Result
16