Sonograms (ultrasounds) are very accurate, to within a few days, in the first trimester. They are accurate to within about two weeks for the second trimester. They are accurate to within about 3 weeks in the third trimester. Note that your due date will not change once established.
By accurate here, i mean "able to accurately determine gestational age (how far along you are) without knowing lmp.