I cleaned up the function a little, but it still feels like a hack:

uint getAge(uint yyyy, uint mm, uint dd) {
  import std.datetime;
  SysTime t = Clock.currTime;
  ubyte correction = 0;
  if(
    (t.month < mm) ||
    ( (t.month == mm) && (t.day < dd) )
  ) correction += 1;
  return (t.year - yyyy - correction);
}

Isn't there anything better?

Reply via email to