Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GOMONTH(DATE(),-(YEAR(DATE())-1753)*12)
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00347376
Message ID:
00347694
Views:
26
>> It clearly looks like a bug, it bugs me for sure, but it is probably very friendly to everybody else -

It's not a coincidence that GOMONTH() breaks down before 1753. The Gregorian calendar (the one we use today) was officially adopted by Britain and her colonies in 1752. Prior to that but after the modification of the Julian calendar by Pope Gregory in 1582, is a period during which the expression of a date can be ambiguous depending on which calendar was in use by the author. That's why old records frequently use "double dates" like "24 Feb 1790/1" ... meaning 1790 or 1791, depending on whether you happen to prefer the Julian or Gregorian calendar.

For Britain and her colonies, the overlap and ambiguity only applies to dates that are between Jan 1 and Mar 24 of those years. But it is different for other countries which adopted the new calendar on different years. In your country of Canada, for instance, it depends on the province. Mainland Nova Scotia reportedly used the Gregorian calendar from 1605-1710, then the Julian calendar from 1710-1752, then used the Gregorian calendar again starting 14 Sep 1742. But even that is disputed by some scholars. (And you thought Y2K was a headache!)

IOW, date calculations prior to 1753 are very unreliable and should only be done when you've got other information about the geographic area in question and the calendar(s) that were in use at the time. IMHO, it is probably best that VFP brought this problem to your attention by returning an empty date.

>> nobody other than you and me seems to care...

Those of us who deal with such old records DO care ... but then I don't rely on GOMONTH() in the first place since it is mathematically inconsistent. That is,

GOMONTH({05/31/1999},-1) = {04/30/1999}
but
GOMONTH({04/30/1999},1) = {05/30/1999}

(or x-1+1 does not equal x). That's not VFP's fault, per se, but the nature of our screwy calendar. But the precise meaning of a tombstone that reads "Died 31 May 1899 at age 1 month" can't be determine by something as simplistic as GOMONTH( ). The same is true about dates prior to 1753.

Hope this helps.

-Bob
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform