Subject Re: [firebird-support] Re: Newbie: Setting the Date format
Author Helen Borrie
At 11:15 AM 9/10/2003 +0200, you wrote:
>I don't know what OS you are using, but in windows, whatever is displayed
>(as opposed to whatever is stored) depends on your regional settings.
>I understand that (again, however it is actually stored), FB accepts
>several different date formats. In my case, I am using Delphi as a
>development tool for the client side GUIs, so what I display to the user is
>not related to what is stored in the database.
>In order to force a certain date format before I post to the DB, I call
>SetShortDateFormat or a similar procedure; but I find that I seldom have to
>worry about that. If I have to pass an SQL string containing a date to some
>query object, then generally I will build the string, making sure that the
>date is in the format 'DD-MMM-YYYY' (e.g., '09-OCT-2003') which I have
>found is accepted by all SQL servers that I have used.
>All my applications use DD/MM/YYYY format.

To add to Tim's and Svein's comments - unlike a lot of other DBMS, Firebird
doesn't store date types as strings. They are stored as a pair of
conjoined numbers. The "interface" between "what users see" (a string) and
"what the database stores" (this number construct) is known as a "date
literal" - a string that gets parsed according to some fairly free rules
and get munged into this number.

In fact, 'dd/mm/ccyy' and 'dd/mm/yy' are pretty close to being the only
invalid ones. And, yes, I've lived in "the rest of the world" most of my
life so I hate the cultural bias that Borl designed into all of its
products. Back when I started using TurboPascal and Paradox 3, MM/DD/YY
was the *only* valid date format. Pdox 3.5 around 1990 introduced date
literals and a certain degree of Y2K sensitivity, and in came
DD.MM.CCYY. Firebird actually has volumes of valid formats. If you're
curious, study the IB6 Data Definition Guide.