Page 1 of 1
Minimal julian calendar date
Posted: Mon 09 Sep 2013 07:07
by cemick
Query return unexpected result.
Code: Select all
select TO_DATE(1, 'J') dDate from dual
Field value as float return 1027063. As date 01.01.4712. It is a errror.
I was expecting to get 01.01.4712
bc or 00.00.0000.
Re: Minimal julian calendar date
Posted: Mon 09 Sep 2013 08:49
by AlexP
Hello,
We get the value returned by the database. You can check your query in the standard SQLPlus or Oracle SQL Developer utilities - the query execution results will be similar.
Re: Minimal julian calendar date
Posted: Mon 09 Sep 2013 13:42
by cemick
Pl/sql developer return 0.00.0000
sqlplus: 01-JAN-12
Re: Minimal julian calendar date
Posted: Tue 10 Sep 2013 07:59
by AlexP
Hello,
According to Julian calendar, time counting starts from 01-01-4712, time format in SQLPlus depends on the value of the NLS_DATE_FORMAT field (you can see the settings in the V$NLS_PARAMETERS view). Format display in Delphi depends on the ShortDateFormat variable value. If you need a format similar to the Oracle 'DD-MON-RR' format, you can set ShortDateFormat := 'DD-MMM-YY';