"Happy Birthday President @ashrafghani...Got the date right this time. :)," Modi tweeted.
Ghani responded by a tweet: "Bahut dhanyavaad Mr. PM. It's always a delight to hear from such dear friend of mine and a strong supporter of our people."
Modi had earlier committed a mistake when he wished the Afghan President wrongly on February 12.
"Happy birthday @ashrafghani. Praying for your long life & exceptional health and a joyful journey ahead," the Prime Minister had tweeted on that day.
The faux pas had led to trolling of the Prime Minister on the social media.