【发布时间】:2009-04-06 20:05:14
【问题描述】:
我在 PostgreSQL 中有一个 timestamp with timezone 字段。 当我更新这个字段时,我会使用这样的东西:
$date = date('Y-m-d H:i:s');
虽然 SQL 运行良好,但保存的日期似乎与经典的 timestamp with timezone 日期有点不同。
Example:
Default value set to "now()":
date 2009-04-06 14:39:53.662522+02
Update with a date set in php:
$date = date('Y-m-d H:i:s');
date 2009-04-06 14:39:53+02
更新时删除的数字可能是毫秒,但我不确定。 我想知道是否有办法用PHP获得相同格式的日期?
【问题讨论】:
标签: php postgresql date timestamp