설문조사
PostgreSQL/PPAS 관련 듣고 싶은 교육은
결과보기
EnterpriseDB
총 게시물 95건
목록 글쓰기 이전글 다음글

날짜 표준 포맷 변경

글쓴이 : PostgresDBA   날짜 : 2012-12-14 (금) 23:45   조회 : 8858 인쇄
scott@[local]:5432 scottdb#SQL> show datestyle;
 DateStyle 
-----------
 ISO, YMD
(1 row)

Time: 0.210 ms
scott@[local]:5432 scottdb#SQL> select cast('1997-02-01' as date), cast('1997-02-01' as timestamp);
    date    |      timestamp      
------------+---------------------
 1997-02-01 | 1997-02-01 00:00:00
(1 row)

Time: 0.184 ms
scott@[local]:5432 scottdb#SQL> set datestyle to 'US, SQL';
SET
Time: 8.321 ms
scott@[local]:5432 scottdb#SQL> show datestyle;
 DateStyle 
-----------
 SQL, MDY
(1 row)

Time: 0.147 ms
scott@[local]:5432 scottdb#SQL> select cast('1997-02-01' as date), cast('1997-02-01' as timestamp);
    date    |      timestamp      
------------+---------------------
 02/01/1997 | 02/01/1997 00:00:00
(1 row)

Time: 0.178 ms
scott@[local]:5432 scottdb#SQL> 

댓글목록

목록 글쓰기 이전글 다음글

postgresdba.com