Rh negative blood

This is my first pregnancy and I’m RH negative and my doctor told me I don’t have to get the shot until I’m 28 weeks but I thought it was 20 weeks? Anyone else Rh negative, when did you get the shot? And does it hurt?