ang.pascal.delphi.misc, Ronald van der Pas
< XXXX@XXXXX.COM > posted at Wed, 17 Sep 2003 14:05:06 :-
You are saying that the string '8-9-2003' is actually written in your
Delphi code, with the intent that it be used to set a TDateTime to
represent one of Aug 9 2003 / 8 Sep 2003.
Since that is neither infallible nor necessary, don't do it. Instead,
DateAppointment:=EncodeDate(2003, 8, 9); // or 9, 8
which is only one character longer, and infallible, and unambiguous.
NEVER rely on the interpretation of an all-numeric date string, if it
can be avoided, unless you are following ISO-8601.
The EncodeDate Help, in D3, is shoddy; the Example should give 1983 not
83, or the text should refer to special treatment of low first
?John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ?
Web <URL: http://www.yqcomputer.com/
; - w. FAQish topics, links, acronyms
PAS EXE etc : <URL: http://www.yqcomputer.com/
; - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.