How to extract hour from query in postgres

后端 未结 3 1443
后悔当初
后悔当初 2021-01-17 07:28

I have timestamp in my table and i want to extract only hour from it. I search and find a extract function but unable to use as a query. Do i need to convert first timestamp

3条回答
  •  情深已故
    2021-01-17 07:57

    The following should work

    select extract(hour from observationtime) from smartvakt_device_report
    

提交回复
热议问题