When Microsoft sign-in says your code is wrong, a page won’t load, or you get “clock skew” style errors, the cause is often simple: your Mac’s time or time zone doesn’t match reality closely enough. Tokens and certificates are picky about time.
Start with the fastest fix below, then only go deeper if it doesn’t stick.
Before you begin: you don’t need to reinstall Microsoft apps for this. Fixing system time is usually enough.
1. Fastest fix (Mac): toggle automatic time and time zone
This is the quickest way to force a clean re-sync.
- Open System Settings → General → Date & Time.
- Turn Set time and date automatically off, wait 5–10 seconds, then turn it back on.
- Also toggle Set time zone automatically using your current location off/on.
- Quit the browser you’re using for Microsoft sign-in, reopen it, and try again.
If you’re on a MacBook, do this once on Wi‑Fi (not hotspot) to rule out location/time sync quirks.
2. Two-path guide: iPhone/Android vs Web (pick the one you’re actually using)
Microsoft sign-in often involves your phone (Authenticator/SMS) even if the problem shows up on your Mac.
- If the code is coming from your phone (Authenticator or SMS): confirm your phone’s time is set to automatic. Then generate a fresh code and try again.
- If you’re signing in on the web (Mac browser): fix the Mac time first (step 1), then hard-refresh the sign-in page and try a private window to avoid stale cookies.
A small mismatch on either device can make a brand-new code look “expired” immediately.
3. If it keeps drifting: verify your Mac is using a reliable time server
Automatic time can still be “automatic but wrong” if the network blocks time sync.
- Stay in System Settings → General → Date & Time and confirm automatic time is enabled.
- Change networks temporarily (home Wi‑Fi → phone hotspot, or vice versa) and see if the time snaps into place.
- If you use a work/school network, try off-network once. Some managed networks restrict time services.
Then retry the Microsoft sign-in flow from a fresh tab.
4. Advanced: VPN, proxy, and “location-based” time zone mismatches
Time zone issues are sneaky because your clock can look “right” but your zone is wrong (or your IP looks like it’s in a different region).
- If you use a VPN, disconnect it briefly and retry sign-in.
- If you use iCloud Private Relay or a corporate proxy, test once with it off (just for the login).
- In Date & Time, set the time zone manually as a test. If that fixes it, your location/time-zone detection is the part failing.
After you’re signed in, you can turn protections back on—this step is about confirming the cause.
5. Advanced: check for managed profiles or security software that enforces time rules
If this is a work or school Mac, device management can lock time settings or route traffic in a way that breaks time sync.
- Open System Settings → Privacy & Security → look for Profiles (or Device Management).
- If profiles exist and you can’t change time settings, your admin may be enforcing them.
- Temporarily disable third-party “web shield” or HTTPS inspection features in security apps (if you have them) and retry sign-in.
If you’re not sure what you’re looking at, don’t remove profiles blindly—ask whoever manages the Mac.
Final thoughts
Microsoft sign-in is sensitive to clock drift because it relies on short-lived tokens and secure certificates. Fixing time automatically (and making sure it stays synced) resolves most “wrong code” or “can’t sign in” loops on Mac.
If your time is correct but sign-in still fails, the next most likely culprits are VPN/proxy interference or a managed profile enforcing network rules.