Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
I'm guessing that the front slashes are being read as divide signs.
Besides converting to seconds, is it possible to compare dates in terms of which is later/earlier? Or do I have to convert to seconds and then compare?
function numericDate pDate
set the itemDel to slash
-- get the month and pad to 2 digits if necessary
put item 1 of pDate into tMonth
if tMonth < 10 then put "0" before tMonth
-- get the day and pad to 2 digits if necessary
put item 2 of pDate into tDay
if tDay < 10 then put "0" before tDay
-- the year is always 4 digits in the dateItems so just put it together and return the number
return item 3 of pDate & tMonth & tDay
end numericDate
put numericDate(fld "Date Start") into tStart
put numericDate(fld "Date End") into tEnd
if tStart < tEnd then
-- do stuff
end if
This won't help in the specific case you're exploring, but helpful for other algos: dates can be compared in the sort command when specifying datetime, e.g.:
sort lines of tList datetime
Richard Gaskin LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn