Regarding the Divine Mercy Indulgence

The Church teaches that: It is appropriate, but not necessary, that the sacramental Confession and especially Holy Communion...take place on the same day that the indulgenced work is performed; but it is sufficient that these sacred rites and prayers be carried out within several days (about 20) before or after the indulgenced act.

Click here to see the full article from Vatican Website