Smoker sayed 22 years in anime, and Gol D. Rodger was in prison for 1 year before execution, Ace was born after 15 months, so its like less than half year after Gol D. died.
Where does it say that Roger was in prison for a year?
As far as I remember it was the crew that disbanded a year prior to the execution, not Roger being captured.
Anyways, you're right about Ace being born 15 months after Rogers death, so if we say that Roger was not in prison for a year it adds up.
Roger was executed in 1500.
Ace is born 15 months after that on January 1st (1502)
Roger must therefor have been executed in the fall of 1500.
Ace is 3 years older than Luffy.
January 1st, 1505 - Ace turns 3.
May, 1505 - Luffy is born. Ace is 3 years and 5 months.
21,7 years after Rogers death:
May, 1522 - Luffy is 17. Ace is 20 and 5 months.
Luffy is probably in Lougetown in June (21 years and about 8 months after Rogers death)
so it makes sense for Smoker to say that it's been 22 years.
During the MarineFord Arc the Luffy has been traveling for a bit longer, so the ages are:
Luffy - 17 years + a couple of months
Ace - 20 years and 5 months + a couple of months.
It adds up.
Also after the 2 year timeskip Luffy would be 19 + a couple of months and Ace is still 20 because he is.. well.. dead..