Date Comparison Problems (was Date)
Rob Cozens
rcozens at pon.net
Mon Sep 11 11:42:48 EDT 2006
Oops!
> get systemDateFormat() -- see below
function systemDateFormat
put "1999,1,9,0,0,0,0" into testDate
convert testDate to short system date -- MC pads day/month
regardless of settings
put 2 into characterNumber
repeat while char characterNumber of testDate is in "1,9"
add 1 to characterNumber
end repeat
put char characterNumber of testDate into dateSeparator
put empty into returnDateFormat
set the itemDelimiter to dateSeparator
repeat for each item datePart in testDate
if datePart > 9 then
if datePart > 99 then put "y" after returnDateFormat
put "y" after returnDateFormat
else if datePart > 1 then
if length(datePart) > 1 then put "d" after returnDateFormat
put "d" after returnDateFormat
else
if length(datePart) > 1 then put "m" after returnDateFormat
put "m" after returnDateFormat
end if
end repeat
return returnDateFormat&dateSeparator
end systemDateFormat
--
Rob Cozens
CCW, Serendipity Software Company
"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."
from "The Triple Foole" by John Donne (1572-1631)
More information about the use-livecode
mailing list