2

如何让 Vertica 函数to_date('','format')输出如下:

DDMonYYYY - 01/ABR/2012 

和它不一样(01-04-2012)?!

dbadmin=> select now();
              now
--------------------------------
 19/09/2012 11:03:48.284339 BRT
(1 row)

dbadmin=> show datestyle;
   name    | setting
-----------+----------
 datestyle | SQL, DMY
(1 row)
4

2 回答 2

6

尝试这个:

SELECT TO_CHAR(CURRENT_TIMESTAMP, 'DD/MON/YYYY');
于 2012-11-15T09:55:53.490 回答
0

to_date() takes a string and converts it into a date object. The output you see returned is not formatted to the specified format. It is just an acknowledgement that the date object got created.

于 2012-09-19T23:30:56.663 回答