【问题标题】:converting string with offset to timestamp in postgresql在postgresql中将带有偏移量的字符串转换为时间戳
【发布时间】:2016-06-01 18:22:03
【问题描述】:

如何转换

'25/02/2014 10:49:13 -8'(datatype is VARCHAR)

'2014-02-25 13:50:13.000000'(datatype is TIMESTAMP)

在PostgreSQL中

我相信时间戳是 EST 时区。

【问题讨论】:

  • 找到解决方案了吗?我也无法解析我的字符串的偏移量。

标签: postgresql timezone timestamp offset


【解决方案1】:

试试方法

to_timestamp

例子:

to_timestamp('01 Jan 2007 09:09:09', 'DD Mon YYYY HH:MI:SS')

希望对你有帮助

【讨论】:

  • 不,它没有,我尝试过 to_timestamp 但偏移量会导致不平衡。我希望将占时区的偏移量转换为 EST 时区,因为我的其他列都是这种格式。
猜你喜欢
  • 1970-01-01
  • 2022-06-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-04-10
相关资源
最近更新 更多