It is not known if Mr Modi himself wrote the erroneous tweet. His posts are reportedly written by his social media manager, Hiren Joshi.
And it is unlikely Mr Ghani, who is at Munich Security Conference, wrote the polite reply, as any posts written by the president himself are signed AG.
Given there at least 22.2m Twitter users in India and that Mr Ghani has more than 176,000 followers, the mistake was spotted by plenty of people.
One Twitter user in India, replied to Mr Ghani: "We don't care when you b'day is , if our honourable PM has wished you today, we will celebrate it today."
Another, Richard Rego, said it was "the biggest international joke from someone occupying the biggest chair in the biggest democracy".