Converting a String to a TIMESTAMP WITH LOCAL TIME ZONE
SQL> SELECT CAST('30-JUN-12' AS TIMESTAMP WITH LOCAL TIME ZONE) FROM dual;
CAST('30-JUN-12'ASTIMESTAMPWITHLOCALTIMEZONE)
---------------------------------------------------------------------------
30-JUN-12 12.00.00.000000 AM
SQL>
SQL> SELECT CAST(TO_TIMESTAMP_TZ('2012-04-21 06:21:31.1234 PST','YYYY-MM-DD HH24:MI:SS.FF TZR') AS TIMESTAMP WITH LOCAL TIME ZONE) FROM dual;
CAST(TO_TIMESTAMP_TZ('2012-04-2106:21:31.1234PST','YYYY-MM-DDHH24:MI:SS.FFT
---------------------------------------------------------------------------
21-APR-12 06.21.31.123400 AM
SQL>
SQL> SELECT CAST(TO_TIMESTAMP_TZ('2012-04-21 06:21:31.1234 EST','YYYY-MM-DD HH24:MI:SS.FF TZR') AS TIMESTAMP WITH LOCAL TIME ZONE) FROM dual;
CAST(TO_TIMESTAMP_TZ('2012-04-2106:21:31.1234EST','YYYY-MM-DDHH24:MI:SS.FFT
---------------------------------------------------------------------------
21-APR-12 03.21.31.123400 AM
SQL>
SQL>
Home »
Oracle »
Conversion Functions »
Oracle »
Conversion Functions »
CAST:
- CAST
- Converting a String to a TIMESTAMP WITH LOCAL TIME ZONE
Related: