Board index » delphi » Date format problem

Date format problem

Greetings
Why is it that I can sometimes send my db a date in UK format (dd/mm/yyyy)
and sometimes I can't. I know IB Console accepts UK format but when using
IBX i need to get the date and re-format it in US (mm/dd/yyyy) format. It's
not a big job but i'm sure there is a better way to go about it.

Thanks in advance.

William

 

Re:Date format problem


Hi William

I had this problem. seems that if the dd/mm/yyyy can only be that eg
31/10/2001 then that is how it is handled, if it can be read as mm/dd/yyyy
then it does that.

Now I always format my dates 'dd-mmm-yyyy' as in 10-jan-2001, and have no
problems

Quote
"William Buchanan" <william.bucha...@bdml.co.uk> wrote in message

news:3b94ab9b$1_2@dnews...
Quote
> Greetings
> Why is it that I can sometimes send my db a date in UK format (dd/mm/yyyy)
> and sometimes I can't. I know IB Console accepts UK format but when using
> IBX i need to get the date and re-format it in US (mm/dd/yyyy) format.
It's
> not a big job but i'm sure there is a better way to go about it.

> Thanks in advance.

> William

Re:Date format problem


Seems like a very hap-hazzard setup. I like your idea thoug - definately
saves confusion!

Thanks for the reply.

William

Quote
"Russell Weetch" <russ...@systematicmarketing.com> wrote in message

news:3b94c9d1$1_1@dnews...
Quote
> Hi William

> I had this problem. seems that if the dd/mm/yyyy can only be that eg
> 31/10/2001 then that is how it is handled, if it can be read as mm/dd/yyyy
> then it does that.

> Now I always format my dates 'dd-mmm-yyyy' as in 10-jan-2001, and have no
> problems

> "William Buchanan" <william.bucha...@bdml.co.uk> wrote in message
> news:3b94ab9b$1_2@dnews...
> > Greetings
> > Why is it that I can sometimes send my db a date in UK format
(dd/mm/yyyy)
> > and sometimes I can't. I know IB Console accepts UK format but when
using
> > IBX i need to get the date and re-format it in US (mm/dd/yyyy) format.
> It's
> > not a big job but i'm sure there is a better way to go about it.

> > Thanks in advance.

> > William

Re:Date format problem


IBConsole uses IBX for all its InterBase work.  IBX uses the normal Delphi
DateTime stuff (+ the IB API).  Look at the short date format for your
application to see if it is set to the regional settings or not.  It should pull
from the OS regional settings.

Quote
William Buchanan wrote:

> Greetings
> Why is it that I can sometimes send my db a date in UK format (dd/mm/yyyy)
> and sometimes I can't. I know IB Console accepts UK format but when using
> IBX i need to get the date and re-format it in US (mm/dd/yyyy) format. It's
> not a big job but i'm sure there is a better way to go about it.

> Thanks in advance.

> William

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:Date format problem


Many thanks for the reply Jeff!
That definately clears up my query.

William

"Jeff Overcash (TeamB)" <overc...@onramp.net> wrote in message
news:3B94E29C.858D4E4F@onramp.net...

Quote
> IBConsole uses IBX for all its InterBase work.  IBX uses the normal Delphi
> DateTime stuff (+ the IB API).  Look at the short date format for your
> application to see if it is set to the regional settings or not.  It
should pull
> from the OS regional settings.

> William Buchanan wrote:

> > Greetings
> > Why is it that I can sometimes send my db a date in UK format
(dd/mm/yyyy)
> > and sometimes I can't. I know IB Console accepts UK format but when
using
> > IBX i need to get the date and re-format it in US (mm/dd/yyyy) format.
It's
> > not a big job but i'm sure there is a better way to go about it.

> > Thanks in advance.

> > William

> --
> Jeff Overcash (TeamB)   I don't think there are any Russians
> (Please do not email    And there ain't no Yanks
>  me directly unless     Just corporate criminals
>  asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:Date format problem


I think I have discovered where the confusion has crept in - correct me if
i'm wrong.....
I have been running queries through the Delphi SQL editor at design time.
This appears to only like US format dates, which seems strange considering
it likes local dates at runtime.
Is this correct?

William

"Jeff Overcash (TeamB)" <overc...@onramp.net> wrote in message
news:3B94E29C.858D4E4F@onramp.net...

Quote
> IBConsole uses IBX for all its InterBase work.  IBX uses the normal Delphi
> DateTime stuff (+ the IB API).  Look at the short date format for your
> application to see if it is set to the regional settings or not.  It
should pull
> from the OS regional settings.

> William Buchanan wrote:

> > Greetings
> > Why is it that I can sometimes send my db a date in UK format
(dd/mm/yyyy)
> > and sometimes I can't. I know IB Console accepts UK format but when
using
> > IBX i need to get the date and re-format it in US (mm/dd/yyyy) format.
It's
> > not a big job but i'm sure there is a better way to go about it.

> > Thanks in advance.

> > William

> --
> Jeff Overcash (TeamB)   I don't think there are any Russians
> (Please do not email    And there ain't no Yanks
>  me directly unless     Just corporate criminals
>  asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:Date format problem


Quote
William Buchanan wrote:

> I think I have discovered where the confusion has crept in - correct me if
> i'm wrong.....
> I have been running queries through the Delphi SQL editor at design time.
> This appears to only like US format dates, which seems strange considering
> it likes local dates at runtime.
> Is this correct?

The Delphi SQL Editor uses the BDE.  The BDE has its own date format variables.

Quote
> William

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Re:Date format problem


It's all slowly coming together!
Many thanks - I appreciate your time

William

"Jeff Overcash (TeamB)" <overc...@onramp.net> wrote in message
news:3B9638BB.72675EB3@onramp.net...

Quote

> William Buchanan wrote:

> > I think I have discovered where the confusion has crept in - correct me
if
> > i'm wrong.....
> > I have been running queries through the Delphi SQL editor at design
time.
> > This appears to only like US format dates, which seems strange
considering
> > it likes local dates at runtime.
> > Is this correct?

> The Delphi SQL Editor uses the BDE.  The BDE has its own date format
variables.

> > William

> --
> Jeff Overcash (TeamB)   I don't think there are any Russians
> (Please do not email    And there ain't no Yanks
>  me directly unless     Just corporate criminals
>  asked.  Thank You)     Playing with tanks.  (Michael Been)

Other Threads