Subject | Re: [ib-support] FB, US vs UK date formats? |
---|---|
Author | Doug Chamberlin |
Post date | 2002-07-12T17:52:59Z |
At 07/12/2002 01:19 PM (Friday), Jason Frey wrote:
1) You have more control than you may think. Not all the Delphi functions
pay attention to the Windows setting. You can always format the date the
way you want by using the right function, such as FormatDateTime().
2) Delphi apps read the Windows settings when they start up and place the
setting into the ShortDateFormat variable. But you can override this
setting once your app starts. Just set ShortDateFormat to whatever setting
you want the Delphi functions to use. Until it is changed again the
functions which use the default format will use the one you set this
variable to.
3) You can use the DD-MMM-YYYY format in your queries (e.g. 1-JAN-2002) and
this format will work with IB/FB at all times. This is how I format all
dates which are used in my queries. When formatting for display to the user
I usually use the default and I let the Windows settings prevail.
Hope this helps you cope!
>And in fact, that's the query Delphi will spit out in my code, as all ofA few of observations:
>it's DateToStr functions pay attention to Windows settings.
>However, I get no results. To get the same results, I'd have to do the US
>query, even though my results that come up in my grid display in UK format.
>Is there some setting on Interbase/Firebird (we have a mix of them, and the
>same behavior happens on both) that needs to be set for language? I've
>tried searching through the archives, and didn't find anything, nor has any
>of the documentation I've looked at screamed at me "Look here for date
>manipulation issues"
>
>Can someone elighten me as to what's going on?
1) You have more control than you may think. Not all the Delphi functions
pay attention to the Windows setting. You can always format the date the
way you want by using the right function, such as FormatDateTime().
2) Delphi apps read the Windows settings when they start up and place the
setting into the ShortDateFormat variable. But you can override this
setting once your app starts. Just set ShortDateFormat to whatever setting
you want the Delphi functions to use. Until it is changed again the
functions which use the default format will use the one you set this
variable to.
3) You can use the DD-MMM-YYYY format in your queries (e.g. 1-JAN-2002) and
this format will work with IB/FB at all times. This is how I format all
dates which are used in my queries. When formatting for display to the user
I usually use the default and I let the Windows settings prevail.
Hope this helps you cope!