I am using PostgreSql and having a column with datatype as Timestamp with time zone. But from the server its receiving a 'UTC Timestamp' value. I need to convert it to 'Timestamp with time zone' so that further comparisons can be done if required.
我正在使用PostgreSql并且具有数据类型的列作为带时区的时间戳。但是从服务器接收“UTC时间戳”值。我需要将其转换为“带时区的时间戳”,以便在需要时进行进一步的比较。
How can I do that. Please suggest me the ways to convert it and then store.
我怎样才能做到这一点。请建议我转换它然后存储的方法。
1 个解决方案
#1
0
Use the AT TIME ZONE
operator to covert
使用AT TIME ZONE运算符进行转换
-
timestamps without time zone
s totimestamps with time zone
s -
timestamps with time zone
s totimestamps without time zone
s
没有时区的时间戳与时区的时间戳
带有时区的时间戳到没有时区的时间戳
timestamps without time zone
(aka. timestamp
) always considered to be in UTC.
没有时区的时间戳(也称为时间戳)始终被认为是UTC。
#1
0
Use the AT TIME ZONE
operator to covert
使用AT TIME ZONE运算符进行转换
-
timestamps without time zone
s totimestamps with time zone
s -
timestamps with time zone
s totimestamps without time zone
s
没有时区的时间戳与时区的时间戳
带有时区的时间戳到没有时区的时间戳
timestamps without time zone
(aka. timestamp
) always considered to be in UTC.
没有时区的时间戳(也称为时间戳)始终被认为是UTC。