如何 insert current datetime in postgresql insert query
INSERT into Group /Name,CreatedDate/ VALUES /'Test',UTC_TIMESTAMP//, 1/;
这是我使用的请求 mysql - insert 当前日期和时间。
当我使用它时 postgresql, 我低于错误。
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
********** Error **********
ERROR: function utc_timestamp// does not exist
SQL state: 42883
我试过了 , 如下所示,使用
now//
, 但是,他也会插入
"2016-07-07 17:01:18.410677"
. 我需要 insert 格式化
'yyyymmdd hh:mi:ss tt'
.
INSERT into Group /Name,CreatedDate/ VALUES /'Test',UTC_TIMESTAMP//, 1/;
如何 insert 当前日期和时间 insert 要求 postgresql 以上述格式 ?
没有找到相关结果
已邀请:
3 个回复
二哥
赞同来自:
/或者
或者
柱子/ 不是
有 "a format".
您所看到的任何格式都由客户端应用。 SQL, 您使用的。
为了 insert 当前时间使用
,
https://www.postgresql.org/doc ... RRENT
:
到
展示
此值采用另一种格式,更改客户端的配置。 SQL 或格式化值 SELECTing 数据:
为了
/命令行客户端默认情况下/ 您可以使用配置参数配置日期显示格式。
:
https://www.postgresql.org/doc ... STYLE
帅驴
赞同来自:
您还可以联系以下链接。
https://coderoad.ru/15530899/
.
八刀丁二
赞同来自:
.
请阅读官方的各种格式化功能
https://www.postgresql.org/doc ... .html
.