Skip to main content
1 of 7
Zombo
  • 1
  • 7
  • 47
  • 65

This assumes that a month is 1/12 of a year:

#!/usr/bin/awk -f
function mktm(q) {
  return \
  substr(q, 1, 4) * 365.25 + \
  substr(q, 5, 2) * 365.25 / 12 + \
  substr(q, 7)
}
BEGIN {
  printf "%d\n", mktm(ARGV[2]) - mktm(ARGV[1])
}
Zombo
  • 1
  • 7
  • 47
  • 65