Y2K bomb in Visual Basic & Win95

Y2K bomb in Visual Basic & Win95

Post by Rob Pearso » Tue, 29 Jul 1997 04:00:00



Testing some code written in VB4 by an assistant, which
used the Masked Edit control to input a date, with system
date as the default.

I was testing a PC for 2000 RTC/BIOS compliance ( a '96
Pentium which failed ! ) and I ran this code with the
system date set to 29 Feb 2000

It Crashed !

The reasons & solutions :

Win 95 system settings date format defaults to dd/mm/yy
( or mm/dd/yy )  which is why the Masked Edit box only
accepts ##/##/## as a date format

Setting the system clock to 2000 - apparently forces WIN95
to dd/mm/yyyy date format setting,  but the control panel
still show a setting of dd/mm/yy

To get this control to work with ##/##/#### ( or any
application using this control ) the system MUST be set to
dd/mm/yyyy format - but this is not given as an option in
W95 control panel drop-down dialog box, you must select the
dd/mm/yy format then type in the extra  yy's

This now means that any existing applications using a
Masked Edit control previously set to ##/##/## format will
now crash with ANY date entry using the yyyy form.

Fun isn't it ?

 
 
 

Y2K bomb in Visual Basic & Win95

Post by Howard Harv » Wed, 30 Jul 1997 04:00:00



>Win 95 system settings date format defaults to dd/mm/yy
>( or mm/dd/yy )  which is why the Masked Edit box only
>accepts ##/##/## as a date format

>Setting the system clock to 2000 - apparently forces WIN95
>to dd/mm/yyyy date format setting,  but the control panel
>still show a setting of dd/mm/yy

What the application sees is not necessarily consistent.

For example, using the RXLIB DateEdit box in Delphi keeps
the two digit year format.  The year may be set outside
the current century, but returns to the current century
when the DateEdit box is next invoked.
ie in 1997, I can step forward to 2000 and it accepts.
   next time I pull back the DateEdit, the year is 1900
   in 2000, I can step backwards to 1997 and it accepts.
   next time I pull back the DateEdit, the year is 2097!

Quote:

>To get this control to work with ##/##/#### ( or any
>application using this control ) the system MUST be set to
>dd/mm/yyyy format - but this is not given as an option in
>W95 control panel drop-down dialog box, you must select the
>dd/mm/yy format then type in the extra  yy's

The problem with this is that the results are inconsistent
to put it mildly.  Most machines will not hold the format
beyond the next boot.  Have a look at my investigations
in http://dove.mtx.net.au/~hharvey/shortdate.html
(Title: Microsoft Windows 95, Short Dates, and the Year 2000)

Quote:>Fun isn't it ?

Sure is!

Howard

-------------------- "Any personal opinions are!" ---------------------
Howard J. Harvey                  | (W) Phone: +61 8 8259 6322


Salisbury, 5108   South Australia |     http://dove.net.au/~hharvey
---------- c = 1802617499785.254116 furlongs/fortnight ----------------

 
 
 

Y2K bomb in Visual Basic & Win95

Post by CJ Kell » Fri, 01 Aug 1997 04:00:00


Rob,
Can you give me any more specific information about what caused VB to
crash?  We have done some testing with the Masked Edit box, based on your
message, and couldn't force the application to crash.

I apologize for cross posting this into the VB newsgroup.  Has anyone else
using VB experienced similar problems?

Thanks in advance for your help,
Cindy



Quote:> Testing some code written in VB4 by an assistant, which
> used the Masked Edit control to input a date, with system
> date as the default.

> I was testing a PC for 2000 RTC/BIOS compliance ( a '96
> Pentium which failed ! ) and I ran this code with the
> system date set to 29 Feb 2000

> It Crashed !

> The reasons & solutions :

> Win 95 system settings date format defaults to dd/mm/yy
> ( or mm/dd/yy )  which is why the Masked Edit box only
> accepts ##/##/## as a date format

> Setting the system clock to 2000 - apparently forces WIN95
> to dd/mm/yyyy date format setting,  but the control panel
> still show a setting of dd/mm/yy

> To get this control to work with ##/##/#### ( or any
> application using this control ) the system MUST be set to
> dd/mm/yyyy format - but this is not given as an option in
> W95 control panel drop-down dialog box, you must select the
> dd/mm/yy format then type in the extra  yy's

> This now means that any existing applications using a
> Masked Edit control previously set to ##/##/## format will
> now crash with ANY date entry using the yyyy form.

> Fun isn't it ?