Doctor changed due date so confused!

So I had an ultrasound this morning followed by an office visit. I thought my due date was august 22nd this whole time making me 26 weeks 4 days. When the doctor came in he told me he had previously hanged my due date to august 17th based on an earlier ultrasound. Which should I go by? But either way I got to see my precious baby boy!