Oracle PL/SQL/Date Timezone/TO TIMESTAMP TZ

Материал из SQL эксперт
Перейти к: навигация, поиск

TO_TIMESTAMP_TZ("2005-15:31.1234 PST","YYYY-MM-DD HH24:MI:SS.FF TZR")

SQL> --TO_TIMESTAMP_TZ(x,[format]): convert x to a TIMESTAMP WITH TIMEZONE with an optional format for x.
SQL>
SQL> SELECT TO_TIMESTAMP_TZ("2005-05-13 07:15:31.1234 PST","YYYY-MM-DD HH24:MI:SS.FF TZR") FROM dual;
TO_TIMESTAMP_TZ("2005-05-1307:15:31.1234PST","YYYY-MM-DDHH24:MI:SS.FFTZR")
---------------------------------------------------------------------------
13-MAY-05 07.15.31.123400000 AM PST
SQL>
SQL>



TO_TIMESTAMP_TZ(x): Converts the string x to a TIMESTAMP WITH TIME ZONE

SQL> --TO_TIMESTAMP_TZ(x): Converts the string x to a TIMESTAMP WITH TIME ZONE.
SQL>
SQL>
SQL> SELECT TO_TIMESTAMP_TZ("1999-12-01 11:00:00 -8:00",
  2     "YYYY-MM-DD HH:MI:SS TZH:TZM") FROM DUAL;
TO_TIMESTAMP_TZ("1999-12-0111:00:00-8:00","YYYY-MM-DDHH:MI:SSTZH:TZM")
---------------------------------------------------------------------------
01-DEC-99 11.00.00.000000000 AM -08:00
SQL>
SQL>