설문조사
PostgreSQL/PPAS 관련 듣고 싶은 교육은


총 게시물 94건, 최근 0 건
   

날짜 표준 포맷 변경

글쓴이 : PostgresDBA 날짜 : 2012-12-14 (금) 23:45 조회 : 7004
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