Mar 312015
CAST Function-Converting Between Timestamps and Dates

The CAST function can be used to convert a TIMESTAMP to a DATE and vice versa. First let’s convert a TIMESTAMP to a DATE. SELECT CAST(SYSTIMESTAMP AS DATE) ts_to_date FROM   dual; TS_TO_DAT ——— 31-MAR-15 To convert a DATE to a TIMESTAMP do the following. SELECT CAST(SYSDATE AS TIMESTAMP) date_to_ts FROM   dual; DATE_TO_TS ————————————————————————— 31-MAR-15

[Read More]