This actually varies from branch to branch. In the Medical Corp (i.e. physicians) there is no below-the-zone (early) promotion to O-4. "In the zone" is evaluated about 15 months prior to the tentative date which would be 6 years after entry on duty as a O-3. Promotion list comes out about 3 months later. You pin on major on that 6th anniversary. The promotion rate is about 99% and typically only flagged soldiers will miss this (not making weight or not passing a PT test in past year).
I can't speak to the requirements of the other branches. I am told that PA's can get promoted below the zone to O-4. Based on my calculations, a PA in the army program can actually make Major earlier than a physician if you start the clock from the first day of PA school or medical school. I don't know what the promotion picture for psychiatrists is.