Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date conversion in VPF 7

Status
Not open for further replies.

jpower5

Programmer
Mar 2, 2004
25
US
I have an application running in VPF7.
I have a date field, birthdate, and I am getting
"errors" wneh I enter a date...

When I enter "07/29/48" into the date field, it displays {07/29/2048} but..when I enter {07/29/54}, I get {07/29/1954}...

it occurs no matter what date I entered as loing as the year
is less than 54...

has anyone come across this???

 
Take a look at

SET CENTURY ON | OFF | TO [nCentury [ROLLOVER nYear]]


 
Jpower,

The behaviour you are seeing is correct. Since VFP 6.0, any date in which the year is entered as two digits will follow a "rollover" rule. Essentially, if the year is within 50 years of the current year digits, VFP assumes that it is in the current century, otherwise it assumes it is in the previous century.

You can alter the cut-off figure by means of SET CENTURY ... ROLLOVER. If you can't identify a suitable cut-off, the only solution is to force people to enter four digits for the year.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top