set time - Questions
This is a discussion on set time - Questions ; Can some one tell me the correct to corrctly set the time on a Trustix
server?
I have tried date 1146, but it will not change the time. That is what
I found on another site, actually a couple of ...
-
set time
Can some one tell me the correct to corrctly set the time on a Trustix
server?
I have tried date 1146, but it will not change the time. That is what
I found on another site, actually a couple of sites. I also tried
0502241146 and this did not work either.
Thanks
-
Re: set time
-----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)
iD8DBQFCHprtagVFX4UWr64RAjZsAKDNVtxo5G0bwSPoFnOQGT J8aTBk5QCg9fwU
vcNGEwKKEL6UukdEfheACcc=
=zoJt
-----END PGP SIGNATURE-----
-
Re: set time
> 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.
>
>
This has me curious, when you just type date, you get the current date
and time etc.... but it also shows the time zone. How is this changed?
Lynn
-
Re: set time
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Lynn Morrison wrote:
>>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.
>>
>>
>
> This has me curious, when you just type date, you get the current date
> and time etc.... but it also shows the time zone. How is this changed?
- From the TZ envvar, or from /usr/share/zoneinfo/localtime if the TZ envvar isn't
set.
I.e.
lpitcher@merlin:~$ echo $TZ
lpitcher@merlin:~$ date
Thu Mar 24 11:29:50 EST 2005
lpitcher@merlin:~$ export TZ=UTC
lpitcher@merlin:~$ date
Thu Mar 24 16:29:58 UTC 2005
lpitcher@merlin:~$ export TZ=EST5EDT
lpitcher@merlin:~$ date
Thu Mar 24 11:30:09 EST 2005
- --
Lew Pitcher
IT Specialist, Enterprise Data Systems,
Enterprise Technology Solutions, TD Bank Financial Group
(Opinions expressed are my own, not my employers')
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
iD8DBQFCQuwzagVFX4UWr64RAgiWAJ4m5s5PEwL9wcziqtGDB8 xWTfdvAACgocrN
exbf+ELF5hw4a6CMvX5txPI=
=rmi/
-----END PGP SIGNATURE-----