Minimal julian calendar date

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
cemick
Posts: 13
Joined: Wed 08 Oct 2008 11:32

Minimal julian calendar date

Post by cemick » Mon 09 Sep 2013 07:07

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Minimal julian calendar date

Post by AlexP » Mon 09 Sep 2013 08:49

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.

cemick
Posts: 13
Joined: Wed 08 Oct 2008 11:32

Re: Minimal julian calendar date

Post by cemick » Mon 09 Sep 2013 13:42

Pl/sql developer return 0.00.0000
sqlplus: 01-JAN-12

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Minimal julian calendar date

Post by AlexP » Tue 10 Sep 2013 07:59

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';

Post Reply