\usepackage{xifthen}
\newcounter{dobyear}
\setcounter{dobyear}{1983}
\newcounter{dobmonth}
\setcounter{dobmonth}{6}
\newcounter{dobday}
\setcounter{dobday}{22}
\newcounter{age}
\setcounter{age}{\the\year}
\addtocounter{age}{-\thedobyear}
\newtest{\samemonthpastday}{
  \cnttest{\the\month}{=}{\thedobmonth} \AND
  \cnttest{\the\day}{>=}{\thedobday}
}
\newtest{\pastmonth}{
  \cnttest{\the\month}{>}{\thedobmonth}
}
\ifthenelse{\samemonthpastday \OR \pastmonth}{}{\addtocounter{age}{-1}}