'date' and 'clock' show different times

'date' and 'clock' show different times

Post by Hossei » Fri, 29 May 1998 04:00:00



Dear All,

   The time that the 'date' and 'clock' commands show
 are different (exactly an hour). I have used the commands
 timeconfig, setclock, date and clock commands to fix it
 but I couldn't. A friend in this group told me to check
 the timezone and I used 'timeconfig' to do this but still
 the times shown by these commands are different.
   I am using RedHat 5. Even with the clock in the control-
 panel I couldn't fix this problem.
   Any help or advice would be gratefully appreciated.

   Please send a copy of your reply to my email-box if
 possible.

   Regards - Hossein

 
 
 

'date' and 'clock' show different times

Post by Jens Ritte » Fri, 29 May 1998 04:00:00



> Dear All,

>    The time that the 'date' and 'clock' commands show
>  are different (exactly an hour). I have used the commands
>  timeconfig, setclock, date and clock commands to fix it
>  but I couldn't. A friend in this group told me to check
>  the timezone and I used 'timeconfig' to do this but still
>  the times shown by these commands are different.
>    I am using RedHat 5. Even with the clock in the control-
>  panel I couldn't fix this problem.
>    Any help or advice would be gratefully appreciated.

On most unix systems the hardware clock shows GMT (or is it UTC, or
both?). The timezone information is used to adjust the date and time
to the right reading.

So its summer time in UK.

---

Key ID: 2048/E451C639 Jens Ritter
Key fingerprint: 5F 3D 43 1E 24 1E CC 48  1E 05 93 3A A7 10 73 37

 
 
 

'date' and 'clock' show different times

Post by Brian McIlwra » Fri, 29 May 1998 04:00:00


:    The time that the 'date' and 'clock' commands show
:  are different (exactly an hour).

In Redhat 5.0 the file /etc/sysconfig/clock should contain the line
UTC=false
to indicate to the system that the system clock is on local time. If you
WANT the system clock on UTC the effects you describe are correct.

 
 
 

'date' and 'clock' show different times

Post by Jürgen Exne » Fri, 29 May 1998 04:00:00


This is not a bug, this is a feature.
Unless you are working in the NATO military, who uses UTC (aka GMT) as their
time zone worldwide, then the times shown by clock and date are supposed to
be different.

There are three clocks in a UNIX system:
- The hardware clock should run on UTC. This is the time you see and set
with "clock".
- The system time is the amount of elapsed seconds since 01/Jan/1970. This
is the time used by the system everywhere, e.g. file creation dates, etc.
This time will be synchronized with the hardware clock at boot time.
- The user time is the user friendly format. It's based on the system time,
and automatically calculates differences for time zones and daylight saving
time. This is the time shown by date as well as e.g. when _displaying_ a
file creation date.

jue
--
Jrgen Exner; jurgenex AT microsoft.com
Sorry for this anti-spam inconvenience


>Dear All,

>   The time that the 'date' and 'clock' commands show
> are different (exactly an hour). I have used the commands
> timeconfig, setclock, date and clock commands to fix it
> but I couldn't. A friend in this group told me to check
> the timezone and I used 'timeconfig' to do this but still
> the times shown by these commands are different.
>   I am using RedHat 5. Even with the clock in the control-
> panel I couldn't fix this problem.
>   Any help or advice would be gratefully appreciated.

>   Please send a copy of your reply to my email-box if
> possible.

>   Regards - Hossein

 
 
 

'date' and 'clock' show different times

Post by j.. » Sun, 31 May 1998 04:00:00




>Dear All,

>   The time that the 'date' and 'clock' commands show
> are different (exactly an hour). I have used the commands
> timeconfig, setclock, date and clock commands to fix it
> but I couldn't. A friend in this group told me to check
> the timezone and I used 'timeconfig' to do this but still
> the times shown by these commands are different.
>   I am using RedHat 5. Even with the clock in the control-
> panel I couldn't fix this problem.
>   Any help or advice would be gratefully appreciated.

There's nothing to fix.  clock is showing you the system's internal time
which is set to GMT, regardless of where in the world you are.  This is
necessary if you want widely networked computers to behave in a sane
manner.

date is showing you the local representation of the time.  Currently
the UK is on summer time so it's an hour different.  If you try it again
at Christmas you'll find they're both the same.

HTH
John
(Cc:ed to poster)
--
John Winters.  Wallingford, Oxon, England.

The Linux Emporium - a source for Linux CDs in the UK
See <http://www.polo.demon.co.uk/emporium.html>

 
 
 

1. How do I make file creation time same as shown by 'date' command

There is no way I can make the file creation time show as local time on
Linux RedHat? or is there.

$ date
Fri May 25 01:18:47 PDT 2001
$ touch test.txt
$ ls -l test.txt
-rw-rw-r--   1 robert   robert          0 May 25 08:18 test.txt
$

It works that way on my FreeBSD box fine. Always has done?

$ date
Fri May 25 18:30:03 EST 2001
$ touch test.txt
$ ls -l test.txt
-rw-r--r--  1 robert  robert  55199 May 25 18:30 test.txt
$

What do I have to do to make it work that way on the Linux box?

Thanks
Robert

2. dial-in lines

3. time difference between 'date' & 'cron'

4. DOS FDISK

5. 'last' command doesn't show complete login times

6. ANSI patch for color xterm

7. Process START times (ps aux) don't agree with 'date'

8. Somehow my username changed to numbers?

9. Calculating yesterday's date using GNU 'date' (was Re: Require a script)

10. all man pages show '-' chars as '???'

11. 'df' and 'du' show wrong sizes

12. Mach64 'Dot Clocks', Daewoo Monitor 'Modelines'?

13. problems with the 'w' command -- not showing 'what'\