Mr Modi had tweeted his best wishes to Mr Ghani, writing: "Praying for your long life & exceptional health and a joyful journey ahead".
Leading Mr Ghani to gently point out his birthday is, in fact, on 19 May.
Mr Ghani's profile on Google lists his birthday as being on 12 February, which may explain the mistake.