Re: Setting the Date on Linux

"Matt D. Harris" <[email protected]> Mon, 12 Mar 2007 08:24:47 -0500
Newsgroups gmane.org.user-groups.linux.morlug
Message-ID <[email protected]>
Or you can update against the atomic clock at the US naval observatory 
via ntpdate.  If you don't have ntpdate, pretty much every distro has a 
package for it, and you can just run `ntpdate -s ntp.usno.navy.mil`. 
This command can also be added to root's crontab to update periodically, 
say, once daily in order to keep your clock in sync with the real time.
Keep in mind also that since unix time works on a long integer format 
and not the "human readable" date, and doesn't know about things like 
daylight savings time or timezones, you'll probably need a new timezone 
data patch from your distro to conform to the new legislation.  If you 
update Debian or Ubuntu regularly, this shouldn't be a problem, and you 
should've automatically gotten the update some time ago during your 
normal update via apt.
- Matt

Michael Bond wrote:
> 
> for those that need this today, cause you didn't update for whatever reason:
> 
> from the command line:
> date -s "dd MM yyyy hh:mm:ss"
> 
> Example, for 8am on Monday March 12th:
> date -s "12 MAR 2007 08:00:00"
> 
> remember, it works off 24 hour time, so 8pm would be 20, not 8 ;-).
> 
> Mike.
> [email protected] <mailto:[email protected]>

-- 
/*
  * Matt D. Harris         <[email protected]>
  *  Solitox Networks - Lead Project Engineer
  *   [http://mdh.name/]
  */