[英]PostgreSQL: insert sql statement with default timestamp - dbeaver vs php
Given this simple table: 鉴于这个简单的表:
create table comments (
id numeric not null,
comment text,
created timestamp not null default now()
);
Using dbeaver directly on the db from my pc, and executing this statement 直接在我的电脑上使用dbeaver,并执行此语句
insert into comments (id, comment)
select 1111, 'test';
the "created" field of the new record is: 2017-02-24 16:17:21
and that's my correct time (CET). 新记录的“创建”字段是:
2017-02-24 16:17:21
这是我正确的时间(CET)。
When I run the very same statement from a php script (running on a linux-based webserver connected to the db), the result is 2017-02-24 15:17:21
. 当我从php脚本运行相同的语句(在连接到db的基于linux的web服务器上运行)时,结果是
2017-02-24 15:17:21
。 The linux server time is ok (that is, CET). linux服务器时间还可以(即CET)。
What am I missing? 我错过了什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.