Oracle PL/SQL/Date Timezone/TO TIMESTAMP

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

to_timestamp("2003/DEC/13 10:13:18", "YYYY/MON/DD HH:MI:SS")

SQL> select to_timestamp("2003/DEC/13 10:13:18", "YYYY/MON/DD HH:MI:SS") from dual;
TO_TIMESTAMP("2003/DEC/1310:13:18","YYYY/MON/DDHH:MI:SS")
---------------------------------------------------------------------------
13-DEC-03 10.13.18.000000000 AM
SQL>



to_timestamp("2003/DEC/13 10:13:18", "YYYY/MONTH/DD HH12:MI:SS")

SQL> select to_timestamp("2003/DEC/13 10:13:18", "YYYY/MONTH/DD HH12:MI:SS") from dual;
TO_TIMESTAMP("2003/DEC/1310:13:18","YYYY/MONTH/DDHH12:MI:SS")
---------------------------------------------------------------------------
13-DEC-03 10.13.18.000000000 AM
SQL>



to_timestamp("2003/DEC/13 10:13:18", "YYYY/MONTH/DD HH24:MI:SS")

SQL> select to_timestamp("2003/DEC/13 10:13:18", "YYYY/MONTH/DD HH24:MI:SS") from dual;
TO_TIMESTAMP("2003/DEC/1310:13:18","YYYY/MONTH/DDHH24:MI:SS")
---------------------------------------------------------------------------
13-DEC-03 10.13.18.000000000 AM
SQL>
SQL>



to_timestamp("2003/DEC/13 10:13:18", "YYYY/MONTH/DD HH:MI:SS")

SQL> select to_timestamp("2003/DEC/13 10:13:18", "YYYY/MONTH/DD HH:MI:SS") from dual;
TO_TIMESTAMP("2003/DEC/1310:13:18","YYYY/MONTH/DDHH:MI:SS")
---------------------------------------------------------------------------
13-DEC-03 10.13.18.000000000 AM
SQL>



TO_TIMESTAMP(x): Converts the string x to a TIMESTAMP

SQL>
SQL> --TO_TIMESTAMP(x): Converts the string x to a TIMESTAMP.
SQL>
SQL> select to_timestamp("2003/12/13 10:13:18", "YYYY/MM/DD HH:MI:SS") from dual;
TO_TIMESTAMP("2003/12/1310:13:18","YYYY/MM/DDHH:MI:SS")
---------------------------------------------------------------------------
13-DEC-03 10.13.18.000000000 AM
SQL>