8 |
The LA Fox Developer Newsletter
August 1999
Dates and Times
(Con’t
from
page 7)
Text box bug
If you use the DATEO
function
in a text box, and if the system
date is 2000 or later, you will always see a four-digit year,
regardless of SET CENTURY. This is a bug, which appears to
be present in all versions of VFP. There is a simple workaround:
set the InputMask property to 99/99/99.
“Give us back our eleven days"
You probably know that GOMONTH() can be used to add or
subtract a number ot months to or from a date. Thus
GOMONTh((11111990},-12) etums 1/1/1980.
But try this: ~OMoNTH((12I3111752),.12.The result is an invalid
date. fact, GOMONTHO fails for any date before September
14, 1750
What is the significance of that date? There might be no
connection, but it was on September 2, 1752 that England
(along with Great Britain's American colonies) finally got around
to adopting the Gregorian, or New Style, calendar. To bring the
country into line, an 11-day correction was needed. So Septem-
ber 2 was immediately followed by September 14.
We don’t know whether this in any way explains the quirk in
GOMONTHO. But other Visual FoxPro date functions seem
unaware
date
Example
cpoer
correctly returns Thursday. But CDOW({9/2/1752}) incorrectly
returns Saturday — it was in fact a Wednesday (at least it was
in England).
Earliest date
Still in a historical mood, what do you suppose is the earliest
date that VFP can handle? Not {O/0/00}, whieh is considered to
be an empty date. What about {1/1/00)?. Pass that date to
CDOWO, for example, and you will see that it was a Monday.
But ::hink about it. {1/1/00} is not January 1st in the year zero. In
VFP 5.0 or earlier, it is the first day of 1900. Remember, two-
digit years default to l9xx. Similarly, in VFP 6.0, it is taken as
1/1/2000. whieh is a Saturday.
In fact, there never was a year zero. In both the modern
Gregorian calendar and its immediate ancestor, the Julian
calendar, 1 BC was immediately followed by 1 AD. Perhaps the
omission of a zero year was an oversight on the part of
Sosigenes, the Greek astronomer who devised the Julian
calendar. But it’s a fact. And it is at the root of the recurring
argument about whether the third millennium really starts in
2000, or in 2001 as many people assert.
Copyright Mike Lewis Consultants Ltd. 1998.
new daughter. Lauren Christine Campbell was born 8/7/99 at
2:47 p.m. weighing 6 lbs. 15 oz and 20.25 inches in length.
Healthy and happy. You can check her out at http://
www.interthing.com/baby.html
Coot Websites and Great Timewasters, If you’re ever stuck
and wondering what you r,an do to waste a little time, try these:
http://pigeons.net/softwars.htm
http://www.customsavers.com/index_wpdel.html
http://www.danworld.com
http://www.urban75.com/Mag/useless.html
http://setiathome.ssl.berkeley.edu/
http://www.mightycool.com/
For those of you who have always wanted to add interesting
WAV files to your apps, try:
http://www.ce.net/users/jones/wavs.html
http://www.cybermonkeysworld.com/wavs/wavs.html
http://soundamenca.com
Well, that’s about all for now.
It Can’t Get Any Easier....
We’ve come up with an easy way to submit articles to the
LA
Fox
Developer Newsletter
one that has been overlooked for
a long time.
You can submit your articles to Barry Lee at CIS# 72723,3422
on Compuserve, or
brlee@earthlinknet.
These articles can be on any FoxPro-related topic, whether
it
concerns a new technique you’ve discovered, a certain develop-
ment technique you may favor over others, book reviews, etc.
Editor reserves the right to edit or offer constructive comments
concerning submitted articles and accepted articles shall be
considered to be in the public domain.
The quality of this newsletter really depends on the members
that support it, not just read it. And I think we’d all be surprised
by the useful information that could be circulated around the
membership.
So
How ‘bout it?
Page 8
|
8 |