Let's suppose I have a timestamp variable:
select timestamp '2011-02-24 08:30:42 +06:00' from dual;
Is there any way to "truncate" it to something like
'2011-02-24 08:00:00 +06:00'
(I've cut minutes and seconds, but left the timezone)
The target oracle version is 11g r2
SQL> select to_timestamp_tz(to_char(timestamp '2011-02-24 08:30:42 +06:00', 'YYYY-MM-DD HH24 TZH:TZM'), 'YYYY-MM-DD HH24 TZH:TZM') from dual;
TO_TIMESTAMP_TZ(TO_CHAR(TIMESTAMP'2011-02-2408:30:42+06:00','YYYY-MM-DDTZH:
---------------------------------------------------------------------------
24.02.2011 8:00:00,000000000 +06:00
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With