explorers' club

explorations in dev, science, sci-fi, games, and other fun stuff!

Quickly Sync Mac OS’s Time via Script

Leave a comment

I’ve noticed lately that my computer’s time is off by over a minute, sometimes several.  This happens as after I have put my computer in standby by closing the lid.  The problem it causes is that with the time out of sync, I cannot use my auth tokens to log into my work’s VPN.  So instead of opening the Time & Date preferences, I use this one line command to quickly update.

Open Terminal and type:

sudo ntpdate -u time.apple.com

You can even create an alias in your .bash_profile to make it simpler:

alias synctime="sudo ntpdate -u time.apple.com"

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s