Oracle PL/SQL/Date Timezone/TO TIMESTAMP

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

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

   <source lang="sql">

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>

      </source>
   
  


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

   <source lang="sql">

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>

      </source>
   
  


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

   <source lang="sql">

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>

      </source>
   
  


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

   <source lang="sql">

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>

      </source>
   
  


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

   <source lang="sql">

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>


      </source>