时间区域的SYSTIMESTAMP'美国/太平洋地区'

时间:2015-07-01 09:55:49

标签: oracle oracle11g oracle10g timestamp-with-timezone

SYSTIMESTAMP AT TIME ZONE 'US/Pacific'将返回07/01/2015 2:54:27.699071 AM -07:00但我在太平洋时区只需要07/01/2015 2:54:27 AM i.e (MM/DD/YYYY HH12:MI:SS AM Format)

1 个答案:

答案 0 :(得分:0)

TO_CHAR 与所需的格式模型一起使用,以获得所需的输出。

例如,

SQL> SELECT TO_CHAR(SYSTIMESTAMP AT TIME ZONE 'US/Pacific','MM/DD/YYYY HH:MI:SS AM') tm_stamp
  2  FROM dual;

TM_STAMP
----------------------
07/01/2015 03:28:04 AM

SQL>