The trick works like this: Take the current date in the format yyyymmdd and subtract it with your date of birth taken in the same format. Drop the last four digits to get your age.
For example, I was born in August 20th, 1994. Today it is July 13th, 2015.
$$ 20150713 - 19940820 = 209893\\ \textrm{Dropping the last four digits,}\\ \textrm{My age}=20 $$
I can understand subtracting two years, but how does crafting these numbers with month and day make it more accurate?
yyyymmdd = year*10000 + month*100 + day– Sanya_Zol Jul 13 '15 at 17:53