LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-24-2013, 11:07 PM   #1
branddonchau
Member
 
Registered: Mar 2013
Posts: 36

Rep: Reputation: Disabled
Question command 'clock' and 'date'


Hello all,

I'm strange why the result is different between 'clock' and 'date' command ; the result(time) of 'clock' is delay around 1 minute ; I think those commands according to my OS time and show the result, so i'm not understand why the result show different. Who can advise? Thanks

Brgds/Brandon Chau
 
Old 03-24-2013, 11:48 PM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Which distro you're on?

Perhaps 'date' command is showing time in different time zone, and 'clock' is showing something else. However, if it's not the case, then run commands with option to check seconds as well, then you can compare both times, as:
Code:
~$ date +%H%M%S
~$ clock +%H%M%S  (Not sure about syntax, so check it first through manual of clock cmd)
 
Old 03-25-2013, 12:23 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
When I do man clock, it redirects to hwclock; the actual on-chip clock that 'runs' even when the system is down. 'date' is the time as seen by the kernel.
See the manpage of clock/hwclock for full discussion and/or http://linux.die.net/sag/hw-sw-clocks.html
 
Old 03-25-2013, 12:56 AM   #4
branddonchau
Member
 
Registered: Mar 2013
Posts: 36

Original Poster
Rep: Reputation: Disabled
Hi shivaa

I'm using F15

Hi chrism01,

OK, thanks.

Brgds/Brandon Chau
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting system date and time affecting the clock and date on BIOS satimis Ubuntu 7 09-21-2007 09:02 AM
how to sync hw clock with date procfs Linux - General 2 01-10-2007 11:31 PM
KDE clock does not match date(1) output MegMcR Linux - Software 2 11-01-2006 06:26 PM
Adjust system date to hardware clock Winanjaya Linux - General 1 10-13-2006 06:52 AM
date and clock problem matrixon Linux - Software 1 02-13-2006 12:09 AM


All times are GMT -5. The time now is 10:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration