Foxpro 2.5b - Year 2000 Date Fix

Foxpro 2.5b - Year 2000 Date Fix

Post by David C » Wed, 22 Jan 1997 04:00:00



Is there a patch available that will cause Foxpro 2.5b to recognize
years in the range 00-50 to be 20?? instead of 19?? I read that
Microsoft will being doing just that on new releases of Access. I
realize that 2.5b is not the latest release of Foxpro for DOS and if
2.6 or later will fix it I'm willing to upgrade. Going to Visual
Foxpro or Foxpro for Windows is not an option at this time.

Thanks
David

 
 
 

Foxpro 2.5b - Year 2000 Date Fix

Post by patrick finuca » Thu, 23 Jan 1997 04:00:00


You could write a simple function to do what you need...and insert it into
the valid code of the field.  However, what if you want to display the year
in screens or report so diffentiation is made between 19 and 20?  That can
throw your spacing off!  I'm doing some conversion work right now...it moves
along pretty fast...if you have a keyword set to look for in the code.

You may want to spend some time to update what you have and for new stuff
build in year 2000 compliance.  I wouldn't trust a patch too much since you
have be looking for years via DTOC() or echoing them out with CTOD() and
explicitly stating the starting positions...or you may have
RIGHT(STR(YEAR(date),4,2).  I doubt you'll find a patch that can determine
when you are looking for or at date fields all the time.


says...

Quote:

>Is there a patch available that will cause Foxpro 2.5b to recognize
>years in the range 00-50 to be 20?? instead of 19?? I read that
>Microsoft will being doing just that on new releases of Access. I
>realize that 2.5b is not the latest release of Foxpro for DOS and if
>2.6 or later will fix it I'm willing to upgrade. Going to Visual
>Foxpro or Foxpro for Windows is not an option at this time.


 
 
 

Foxpro 2.5b - Year 2000 Date Fix

Post by Arnon Gal-O » Thu, 23 Jan 1997 04:00:00


Quote:> Is there a patch available that will cause Foxpro 2.5b to recognize
> years in the range 00-50 to be 20?? instead of 19?? I read that
> Microsoft will being doing just that on new releases of Access. I
> realize that 2.5b is not the latest release of Foxpro for DOS and if
> 2.6 or later will fix it I'm willing to upgrade. Going to Visual
> Foxpro or Foxpro for Windows is not an option at this time.

VFP5.0 already has this option
FPD2.6 is the last dos version and there will not be other releases
your corrent option is to write some code that will go in the WHEN or VALID
to correct this

sorry

Arnon

 
 
 

Foxpro 2.5b - Year 2000 Date Fix

Post by Christopher A. Re » Fri, 24 Jan 1997 04:00:00


On Tue, 21 Jan 1997 19:10:25 GMT in article

Quote:

>Is there a patch available that will cause Foxpro 2.5b to recognize
>years in the range 00-50 to be 20?? instead of 19?? I read that
>Microsoft will being doing just that on new releases of Access. I
>realize that 2.5b is not the latest release of Foxpro for DOS and if
>2.6 or later will fix it I'm willing to upgrade. Going to Visual
>Foxpro or Foxpro for Windows is not an option at this time.

>Thanks
>David

You can force your users to input the 4-digit year.  Since FoxPro
stores the full year to begin, then your problem is how it is
entered.  Hence, making your users type in "1959" or "2010" should
resolve your problem.

By the way, FP26 does not have the "fix"; the best solution is
in VFP5.  In addition, since Visual is out, I doubt M$ is going
to fix this in FP2.x.

Hope this helps!

--
Christopher Reed


"Resistance is REALLY futile."

 
 
 

Foxpro 2.5b - Year 2000 Date Fix

Post by df.. » Sat, 25 Jan 1997 04:00:00




>You can force your users to input the 4-digit year.  Since FoxPro
>stores the full year to begin, then your problem is how it is
>entered.  Hence, making your users type in "1959" or "2010" should
>resolve your problem.

>By the way, FP26 does not have the "fix"; the best solution is
>in VFP5.  In addition, since Visual is out, I doubt M$ is going
>to fix this in FP2.x.

>Hope this helps!

>--
>Christopher Reed


>"Resistance is REALLY futile."

Thats what I was afraid of. Thanks anyway. We have many programs that
were written over the past eight years that use fixed masking for date
input ie "99/99/99" and I wanted to avoid changing them all but it
looks like the next 3 years will be spent doing just that.

Thanks again
David

 
 
 

Foxpro 2.5b - Year 2000 Date Fix

Post by Bill Bardo » Tue, 28 Jan 1997 04:00:00




> >You can force your users to input the 4-digit year.  Since FoxPro
> >stores the full year to begin, then your problem is how it is
> >entered.  Hence, making your users type in "1959" or "2010" should
> >resolve your problem.

> Thats what I was afraid of. Thanks anyway. We have many programs that
> were written over the past eight years that use fixed masking for date
> input ie "99/99/99" and I wanted to avoid changing them all but it
> looks like the next 3 years will be spent doing just that.

If your program deals only with short-term dates, not long-term as in
insurance, it may be easier to place a call to the following function
in the date field's VALID clause.  This function could easily be
parameterized to allow the user to set the date range in a configuration
table.

FUNCTION Yr2000
*!*******************************************************
*!       Ensures dates stored in vars and fields will be
*!       asssigned in correct century.  Good for years
*!       1950 - 2049.
*!*******************************************************
    Parameter In_date

    PRIVATE Mdate, Mcent, Out_date

    Mdate = SET("date")
    SET DATE YMD

    Mcent = SET("CENTURY")
    SET CENTURY ON

    DO CASE
        CASE YEAR(In_date) < 1950
            Yearstr = STR(YEAR(In_date) + 100, 4)
        CASE YEAR(In_date) > 2049
            Yearstr = STR(YEAR(In_date) - 100, 4)
        OTHERWISE
            Yearstr = STR(YEAR(In_date), 4)
    ENDCASE

    Monthstr = STR(MONTH(In_date), 2)
    Daystr   = STR(DAY(In_date), 2)
    Out_date = CTOD(Yearstr + '/' + Monthstr + '/' + Daystr)

    SET CENTURY &mcent
    SET DATE &mdate

    RETURN Out_date

--
Bill Bardon
Elkhorn, Nebraska