【发布时间】:2018-10-27 05:39:29
【问题描述】:
我在 Postgres 中有以下带有纪元时间戳的表格。我想选择时间为 太平洋标准时间 20:00 到 21:00 的时间戳。我已经部分尝试了以下方法,但似乎无法同时提取小时和分钟。
SELECT timestamp from table where extract(‘hour’ from to_timestamp(created_at) at time zone ‘America/Los_angeles’) > 20
| created_at |
| 1526528788 |
| 1526442388 |
| 1526309188 |
| 1526359588 |
| 1526532388 |
| 1526489188 |
预期结果:
| created_at |
| 1526528788 |
| 1526442388 |
任何帮助将不胜感激。
【问题讨论】:
标签: postgresql epoch