JH. Lee
JH. Lee

Reputation: 27

How do i set specific datetime format when insert NOW() in postgreSQL

This is my query.

UPDATE "standardrcpname"
SET savetime = NOW()
WHERE fdcenable = 1;

I want to set save time using yyyy-MM-dd HH:mm:ss format.

How do i set specific datetime format?..

Upvotes: 0

Views: 110

Answers (1)

user330315
user330315

Reputation:

A timestamp column does not have "a format".

Any formatting you see is applied by the program displaying this value.

If you want a different format when displaying the values use to_char(savetime, 'yyyy-MM-dd HH:mm:ss') or configure your SQL client to use a different format.

Upvotes: 3

Related Questions