Well I have this script that lets me store user's date of birth, and i've added this code below to return the age difference between users, but it isnt working correctly and i was hoping one of you kind folks would be able to help me out.
Code:
 if ($1 == !agediff) {
  if ($ini(dob.ini,dob,$2)) {
    set %agenick1 $2
    set %dob1 $readini(dob.ini,dob,%agenick1)      
    if ($ini(dob.ini,dob,$3)) {
      set %agenick2 $3
      set %dob2 $readini(dob.ini,dob,%agenick2)
      if ($ctime(%dob1) > $ctime(%dob2)) {
        %a = $ctime(%dob1) - $ctime(%dob2)
        %years = %a / 31556952
        %div = %a % 31556952
        %months = %div / 2629746
        %days = $int($calc((%div % 2629746)/86400))
        msg $chan %agenick1 is $int(%years) years, $int(%months) months, %days days, older than %agenick2
        unset %agenick*
        unset %dob*
      }
      else {
        %a = $ctime(%dob2) - $ctime(%dob1)
        %years = %a / 31556952
        %div = %a % 31556952
        %months = %div / 2629746
        %days = $int($calc((%div % 2629746)/86400))
        msg $chan %agenick1 is $int(%years) years, $int(%months) months, %days days, younger than %agenick2
        unset %agenick*
        unset %dob*
      }
    }
    else { 
      notice $nick I do not know $+($3,'s) date of birth.
      unset %dob*
      unset %agenick*
    }
  }
  else { 
    notice $nick I do not know $+($2,'s) date of birth.
    unset %dob*
    unset %agenick*
  }
}