New job - when to tell them I’m pregnant?

I start a new job in about a week and I’m 17 weeks pregnant. I didn’t tell them in the interview because I was worried they wouldn’t hire me.

I’ll have to take time off to go to some of my appointments and stuff and I’m wondering when I should tell my boss that I’m pregnant. I just don’t know because it’s a new job. Help!