Mil*_*iez 4 postgresql timestamp type-conversion date postgresql-9.6
我有一个date具有以下值格式的类型列:(YYYY-MM-DD例如。2018-08-03)。我想获得与日期等效的 unix 时间戳,但没有时区。
Fe 日期2018-08-03应该相等1533254400(从这里计算)。
我试过了,to_timestamp(my_date_column, 'YYYY-MM-DD')但它返回 error function to_timestamp(date, unknown) does not exist。我尝试::timestamp...在函数调用结束时添加不同的变体,但无济于事。
目前我在应用程序层进行时间戳转换,但我想将该工作专用于数据库。
| 归档时间: |
|
| 查看次数: |
9170 次 |
| 最近记录: |