Re: How to format date

  • From: Sayan Malakshinov <xt.and.r@xxxxxxxxx>
  • To: Eriovaldo Andrietta <ecandrietta@xxxxxxxxx>
  • Date: Tue, 1 Jun 2021 04:10:04 +0300

Hi Eriovaldo,

You can either use TZR, ie tz region:
select
to_char(
timestamp '1995-10-14 00:00:00'
at time zone 'America/Sao_Paulo'
, 'DY MON dd hh24:mi:ss TZR') str
from dual;

or use hard coded TZR with own saving time condition:
select
to_char(
tstmp
, 'DY MON dd hh24:mi:ss ' ||
case when 1=1 then '"BRST"' else '"BRT"' end) str
from (
select
  timestamp '1895-10-14 00:00:00'
  at time zone 'America/Sao_Paulo' as tstmp
from dual)

Best regards,
Sayan Malakshinov
Oracle performance tuning expert
Oracle Database Developer Choice Award winner
Oracle ACE Associate
http://orasql.org

On Tue, Jun 1, 2021, 02:39 Eriovaldo Andrietta <ecandrietta@xxxxxxxxx>
wrote:

Hi,

I know that the date 01/01/2016 has the result : 'SUN JAN 01 00:00:00 BRST
2006'   ...
This format was generated by java code.
"BRST" means saving time. In fact it was the period of the saving time in
2006.

How can I format this date : 14/10/1895 in the same format above using sql
?

Regards
Eriovaldo





Other related posts: