This is a follow up to TeX capacity exceeded while parsing a date string
I want to compare two dates, say today's date and a due date. I have the due date information stored (as number strings) in macros \dueday, \duemonth, and \duemonth. I use the following, from etoolbox package:
\newcommand{\dueday}{6}
\newcommand{\duemonth}{5} % May
\newcommand{\dueyear}{2012}
\ifboolexpr{
(test {\ifnumcomp{\dueyear}{>}{\year}})
or (test {\ifnumcomp{\dueyear}{=}{\year}} and test {\ifnumcomp{\duemonth}{>}{\month}})
or (test {\ifnumcomp{\dueyear}{=}{\year}} and test {\ifnumcomp{\duemonth}{=}{\month}} and test {\ifnumcomp{\dueday}{>}{\day}})
}
{Not due yet}
{Due immediately}
which does work, but I'm looking for a TeX-based solution that, perhaps, can do this more efficiently and without having to use etoolbox.
\pdfstrcmp. – Ali Mehrizi May 06 '12 at 19:21