Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there Y2K problem in FoxPro ?
Message
From
23/10/1997 08:45:09
 
 
To
22/10/1997 15:16:09
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00056026
Message ID:
00056296
Views:
41
>>>>>>>>>>I am dealing with a project in Visual Foxpro which is having a database of Historical data. I am facing with the problem of entering date that is before 100th century. AD. how do I solve this problem?
>>>>>>>>>
>>>>>>>>>Matt's reply is correct, VFP can handle dates in the range of 01/01/0100 through 12/31/9999 so you can't enter dates in the first century A.D., at least not as date fields. Do you really need full month-day-year information for historical dates that far back? In addition to Matt's suggestion, if all you need is the year, you might want to consider using a character or numeric field to store it.
>>>>>>>>>
>>>>>>>>>BTW, here's a GOTCHA I recently discovered when working with dates: it appears that the GOMONTH() function doesn't work on any dates prior to 01/01/1752. It returns the empty date when used with any earlier dates.
>>>>>>>>>
>>>>>>>>That's when the Western calendar system went from Julian to Gregorian, I believe. They'd need a different function for time prior to that...
>>>>>>>
>>>>>>>Actually, it was the other way around..
>>>>>>>
>>>>>>>Therefor Julian day 1 = 01/01/1752 which affects SYS(1) and SYS(11,)
>>>>>>
>>>>>>----------------------
>>>>>>The value returned by SYS(1) is valid in the U.S.A. You can get Visual FoxPro versions for any system date after September 14, 1752, and before December 31, 9999.
>>>>>>----------------------
>>>>>>The Complete Visual Foxpro system date functions works only within the specified period.
>>>>>>The above lines are from Visual Foxpro Help 4.00.950.
>>>>>
>>>>>OK, I goofed again. Julian Day 1 = 09/14/1752. Hey, nobody's perfect. 'Specially not me.
>>>>
>>>>Hey Cool. Even I donot know regarding this. And since In my office I was asked to give a seminar on Y2K in Foxpro, I started looking at it more and more cloosly. Till you said that Sys function, even I do not know , and was working on your message in VFP and suddenly noticed it in the help file, So I just wanted to inform you. Now I am still working on it.
>>>>
>>>>Even I am not perfect.
>>>>
>>>>If you can , Please solve my 'Data porting ' problem.
>>
>>(sorry about the empty)
>>
>>I'm surprised no one got me on this. I'm wrong...again...and confused...again.
>>
>>Julian Day 1 != 09/14/1752, it's actually somewhere way BC!
>>
>>What even better... try this:
>>
>>
>>? SYS(10,1721119)
>>
>>
>>I though Foxpro couldn't see the 1st century! and why March 0??, 0000, why not Jan 1? I just don't get it. Must be that moldy cheese working overtime
>
>Actually the problem is coming because SYS(10) function is displaying date field . Sys(11) function is displaying 01/03/0000 means
>1st century B.C. March 1st.
>
>and other date functions are working properly in the range Foxpro Help specified only
>
>By the way, 2000 is leap year, 1600 is leap year. 0400 is leap year. and so B.C. is also a leap year. May be because of that Sys(11) function is giving upto March 1st 1st B.C.
>
>Is really 1st B.C. is leap year?

You all are confusing the Julian calendar with the Julian Period. The Julian calendar was established by Caesar in 46 B.C. and replaced by the Gregorian calendar in 1582 (to make up for the loss of one day every 128 years or so). The Julian PERIOD, which relates to SYS(1), SYS(10) AND SYS(11); is actually a method devised by an astronomer Joseph Scaliger in 1582 (named for his father Julius, not for Caeser) to express dates and long time intervals in days rather than years, months and days. Thus avoiding those inconvenient calculations with leap years and such. Julian day #1 began at noon, Jan.1 4713 B.C. (date important to astronomers because it was a convergence of the 28-year solar calendar, the 19-year lunar cycle and the 15-year indiction cycle). Each new day adds to the Julian counter, so this morning is Julian day 2,450,745 because it has been that many days since Julian day #1 (keep in mind that the Julian day changes at noon, not at midnight). It will take 7980 years to complete the Julian Period.

And so ends the lesson of the day :)

Bibligraphy : The World Almanac, 1991.
Previous
Reply
Map
View

Click here to load this message in the networking platform