Re: set time

From: Lew Pitcher (lpitcher_at_sympatico.ca)
Date: 02/25/05


Date: Thu, 24 Feb 2005 22:26:37 -0500


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

suprtiger@excite.com wrote:
> Can some one tell me the correct to corrctly set the time on a Trustix
> server?

Assuming that Trustix uses the Linux "coreutils" date(1), then the correct way
is to use date(1) command to set the system time.

> I have tried date 1146, but it will not change the time.

Probably not.
  date 1146
is not a properly formatted date command.

> That is what
> I found on another site, actually a couple of sites. I also tried
> 0502241146 and this did not work either.

I wouldn't expect
  date 0502231146
to work either. It's still not a properly formatted date command.

If you take a look at the date(1) manpage ("man 1 date"), you'll find that the
short format to set the date and time is
  date MMDDhhmm
as in
  date 02241146
to set the system clock to 11:46 AM on February 24

A longer form is
  date MMDDhhmm.ss
as in
  date 02241146.22
to set the system clock to 11:46:22 AM on February 24

Even longer is
  date MMDDhhmmCCYY.ss
as in
  date 022411462005.22
to set the system clock to 11:46:22 AM on February 24, 2005

Try one of these forms and see if it works for you.

- --
Lew Pitcher

Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCHprtagVFX4UWr64RAjZsAKDNVtxo5G0bwSPoFnOQGTJ8aTBk5QCg9fwU
vcNGEwKKEL6UukdEfheACcc=
=zoJt
-----END PGP SIGNATURE-----



Relevant Pages

  • Re: Steven L Umbanch.
    ... > Semicolon wont even let me complete command successfully. ... > gives error and says invalid date specified. ... > able to log in at 5:05 on system clock. ...
    (microsoft.public.win2000.group_policy)
  • "after" timer script is never called if the system time is set backwards.
    ... script to update that widget's contents to the latest time. ... for the common use case. ... which I use to change the system clock (via the "date" ... I assume there is a problem with the "after" command I use. ...
    (comp.lang.tcl)
  • Re: Problem building YASR
    ... Since you're at the command line, ... -David Chipman ... I wouldn't be doing this stuff as root, ... How do I check the system clock? ...
    (Fedora)
  • [opensuse] Re: Daylight Savings Change
    ... What's all that stuff mean after one does the above command (mine ... Yast. ... But i really don't care if it's fixed. ... system clock runs on UTC. ...
    (SuSE)