Hi,
Here's a routine to sort the dates
(last (sort-date '("7 Sept 2007" "9 Sept 2007" "21 March 2007" "12 April 2000" "21 March 2004" "27 April 2006"))) returns "9 Sept 2007", the latest
(car (sort-date '("7 Sept 2007" "9 Sept 2007" "21 March 2007" "12 April 2000" "21 March 2004" "27 April 2006"))) returns "12 April 2000", the oldest
(defun sort-date (date-lst / year month day)
(defun year (str)
(atoi (substr str (+ 2 (vl-string-position 32 str 0 T))))
)
(defun month (str)
(vl-position
(substr str
(+ 2 (vl-string-position 32 str))
(- (vl-string-position 32 str 0 T) (vl-string-position 32 str) 1)
)
(list "Jan" "Feb" "March" "April" "May" "June"
"July" "Aug" "Sept" "Oct" "Nov" "Dec"
)
)
)
(defun day (str)
(atoi (substr str 1 (vl-string-position 32 str)))
)
(vl-sort date-lst
'(lambda (x1 x2)
(if (= (year x1) (year x2))
(if (= (month x1) (month x2))
(< (day x1) (day x2))
(< (month x1) (month x2))
)
(< (year x1) (year x2))
)
)
)
)