[verb た-form] + ことがある [verb た-form] + ことがない
たことがある says you have done something at least once in your life: "have done", "have ever". The verb is in the た-form, and the negative, たことがない, is "have never". Polite: ことがあります, ことがありません.
たことがある is about experience, not about something that happened at a known time. A recent, dated event takes the plain past.
A period long past is fine, since it is still about your experience.
For the same reason, it sounds odd about something everyone does every day, like eating rice, unless there is a reason to bring it up.
After the dictionary form or the ない-form, ことがある is a different pattern: "there are times when", "sometimes". The た is what tells them apart.
These go beyond plain "have done".
が becomes は when you contrast: you have done it, but only that much, or this but not that.