'database/postgres_ppas'에 해당되는 글 16건

  1. 2016.08.11 PostgreSql now YYYYMMDDHH24MISSMS YYYYMMDDHH24MISSUS

반응형

 

 

postgresql

SELECT to_char(now(), 'YYYY/MM/DD-HH24:MI:SS:MS'::text);

결과

"2016/08/11-18:48:06:547"


SELECT to_char(now(), 'YYYY/MM/DD-HH24:MI:SS:US'::text);

결과

"2016/08/11-18:48:24:492000"

 

 

Pattern Description
YYYY year (4 or more digits)
YYY last 3 digits of year
YY last 2 digits of year
Y last digit of year
MM month number (01-12)
DDD day of year (001-366)
DD day of month (01-31)
D day of the week, Sunday (1) to Saturday (7)
HH hour of day (01-12)
HH12 hour of day (01-12)
HH24 hour of day (00-23)
MI minute (00-59)
SS second (00-59)
MS millisecond (000-999)
US microsecond (000000-999999)

 

 

반응형
Posted by 공간사랑
,