Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一列包含 unix 时间戳 - 一个 int 表示自epoch以来的秒数。它们看起来像这样:1347085827。如何在我的 SELECT 查询中将其格式化为人类可读的日期字符串?
1347085827
Postgresql 有一个方便的内置函数:to_timestamp(). 只需将该函数包装在您想要的列周围:
to_timestamp()
Select a, b, to_timestamp(date_int) FROM t_tablename