Due date help

❤🌺🌼

How does this app calculate the due date? I'm confused because my Dr says I'm due Oct 3rd which is exactly 40 weeks and this app says I'm due Monday the 23rd which is 38weeks4days 🤔 I want to believe the app though lol and plus I used this app to help get pregnant so I'm hoping it's right