Period a week early?

According to this app my period isn't for another 6 days. I just used the bathroom and I got some blood like my period is coming. I know I'm not pregnant because I haven't had sex in almost 3 months. What causes a period to come early?