Board index » delphi » BDE and Y2K date handling

BDE and Y2K date handling

I am using Delphi 4.03 and BDE 5.01.  The BDE setting FOURDIGITYEAR is set
to FALSE. My regional settings shortdate format is "m/d/yy" since that's
what the user is using.

I have a couple TDateTimeFields in a TQuery with RequestLive set to True.
The DisplayFormat := 'mm/dd/yyyy' and the EditMask := '!99/99/0099;1; '

The help says that if the user types a 2 digit year leass than 50 the
century should default to the next century so if the user enters 1/1/01 it
should return 01/01/2001.  When I do it, returns 01/01/1900.

Any ideas why it is ignoring the Y2K handling of the BDE?

Thanks.

 

Re:BDE and Y2K date handling


Hi Matt!

On Fri, 20 Aug 1999 09:24:58 -0700, "Matt Peebles"

Quote
<m...@collinscomputing.com> wrote:
>Any ideas why it is ignoring the Y2K handling of the BDE?

Maybe the following excerpt from the D4 service pack 2 readme file can
help ...

"TwoDigitYearCenturyWindow variable for RTL
------------------------------------------
To make your own Delphi applications handle two digit
years more reliably at the millennium, you should
initialize the SysUtils global variable
TwoDigitYearCenturyWindow to a positive value in the
initialization section of a unit or in the project
file. By making the setting there, it is available as
objects are created with their parent forms.

Assigning a value of 50 to TwoDigitYearCenturyWindow
should be adequate for most applications.  If your
app deals mostly with historical dates, such as birth
dates, you may want to bias the century window towards
the past with a value of 80 (80 years back, 20 years
forward). If your app deals mostly with future dates,
such as due dates or expiration dates, you may want to
bias the century window towards the future, with a
value of 20 (20 years back, 80 years forward)."

tomi.

Re:BDE and Y2K date handling


Thanks, that works.

I guess I need to pay better attention to the ReadMe's.

Quote
Tomislav Kardas <nomail@sorry> wrote in message

news:37bd960d.123708656@forums.inprise.com...
Quote
> Hi Matt!

> On Fri, 20 Aug 1999 09:24:58 -0700, "Matt Peebles"
> <m...@collinscomputing.com> wrote:

> >Any ideas why it is ignoring the Y2K handling of the BDE?

> Maybe the following excerpt from the D4 service pack 2 readme file can
> help ...

> "TwoDigitYearCenturyWindow variable for RTL
> ------------------------------------------
> To make your own Delphi applications handle two digit
> years more reliably at the millennium, you should
> initialize the SysUtils global variable
> TwoDigitYearCenturyWindow to a positive value in the
> initialization section of a unit or in the project
> file. By making the setting there, it is available as
> objects are created with their parent forms.

> Assigning a value of 50 to TwoDigitYearCenturyWindow
> should be adequate for most applications.  If your
> app deals mostly with historical dates, such as birth
> dates, you may want to bias the century window towards
> the past with a value of 80 (80 years back, 20 years
> forward). If your app deals mostly with future dates,
> such as due dates or expiration dates, you may want to
> bias the century window towards the future, with a
> value of 20 (20 years back, 80 years forward)."

> tomi.

Re:BDE and Y2K date handling


Matt,
BDE itself just complete a two digit year with the current century. The more
elegant way controlling it further is provided by Tomy.

Regards
Max

Quote
Matt Peebles wrote:
> I am using Delphi 4.03 and BDE 5.01.  The BDE setting FOURDIGITYEAR is set
> to FALSE. My regional settings shortdate format is "m/d/yy" since that's
> what the user is using.

> I have a couple TDateTimeFields in a TQuery with RequestLive set to True.
> The DisplayFormat := 'mm/dd/yyyy' and the EditMask := '!99/99/0099;1; '

> The help says that if the user types a 2 digit year leass than 50 the
> century should default to the next century so if the user enters 1/1/01 it
> should return 01/01/2001.  When I do it, returns 01/01/1900.

> Any ideas why it is ignoring the Y2K handling of the BDE?

> Thanks.

--
MBS Software Co., Ltd.
67/359 Mooban Tantong 5
Tambon Vichit
Amphur Muang
Phuket 83000

Thailand

Tel: +66 76 242 516
Fax: +66 76 242 383
e-mail: m...@mbs-software.com
http://www.mbs-software.com

Other Threads