LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-16-2010, 04:52 PM   #1
spoovy
Member
 
Registered: Feb 2010
Location: London, UK
Distribution: Scientific, Ubuntu, Fedora
Posts: 373

Rep: Reputation: 43
Set time??


I have tried all sorts of commands - hwclock, clock, date, and timeconfig. Nothing seems to really sort out my problem.

I am in London, UK, but when i set the clock with timeconfig it still sets the time to GMT (London time) -1 hour. I can set it back with date --set=(time) but this reverts with each new session back to GMT -1. I have spent ages googling around on this and tried several different methods but i'm still stuck!

Anyone want to help me out?

Thanks in advance

Spoov
 
Old 08-16-2010, 05:14 PM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
What version Slackware?

What does
Code:
ls -l /etc/localtime-copied-from
give you?

Do the two commands
Code:
sha1sum /etc/localtime-copied-from
sha1sum /etc/localtime
give the same hash values?
 
Old 08-16-2010, 05:30 PM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
For the UK you want to use the 'GB' option in timeconfig, not the 'London' one.
If you dual boot with windows, you'll want the "hardware clock is localtime option", otherwise use the UTC option.

Once you've got that right do a:
ntpdate ntp.virginmedia.com
or use the date command to set the time manually

And then, depending on whether your hardware clock is going to be localtime or utc, either:
hwclock -w --localtime
or
hwclock -w --utc
 
Old 08-17-2010, 12:42 PM   #4
spoovy
Member
 
Registered: Feb 2010
Location: London, UK
Distribution: Scientific, Ubuntu, Fedora
Posts: 373

Original Poster
Rep: Reputation: 43
Richard -

13.1

Code:
lrwxrwxrwx 1 root root 23 2010-08-17 16:35 /etc/localtime-copied-from -> /usr/share/zoneinfo/GMT
And yes the checksums are the same.


GazL -

I tried GB, and GMT, both give the same time (GMT -1).

I dual-boot with Ubuntu, which is set to local time I think (rather than utc)

Last edited by spoovy; 08-17-2010 at 12:46 PM.
 
Old 08-17-2010, 01:20 PM   #5
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by spoovy View Post
Richard -

13.1

Code:
lrwxrwxrwx 1 root root 23 2010-08-17 16:35 /etc/localtime-copied-from -> /usr/share/zoneinfo/GMT
And yes the checksums are the same.
So, that means that you've configured the system to run GMT as the local time.

Do you guys do the daylight savings time thing? If so, there is your hour difference: GMT never does DST.
 
Old 08-17-2010, 04:42 PM   #6
spoovy
Member
 
Registered: Feb 2010
Location: London, UK
Distribution: Scientific, Ubuntu, Fedora
Posts: 373

Original Poster
Rep: Reputation: 43
Yes it was showing GMT when i ran that command, as I was trying different options at the time. I had been using London time though, which I have always selected in previous linux systems I have used. I tried various different options, as in my previous post - GB, GMT, London. All the logical choices give incorrect times.

Yes we are currently on BST (British Summer Time, for which there is no setting) which is GMT+1. Are you telling me that i need to select GMT+1, then remember to change it back to GMT when BST ends? That doesn't sound right to me, that shouldn't be a manual process surely??
 
Old 08-17-2010, 05:10 PM   #7
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
No, GB should do the right thing, but GMT would not. The GB time zone should already know about when British Summer Time starts and stops. The GMT time zone won't care.

What does the command
Code:
echo $TZ
give you? (It may give you a blank line, which is OK.) How about
Code:
date
?
 
Old 08-17-2010, 05:16 PM   #8
spoovy
Member
 
Registered: Feb 2010
Location: London, UK
Distribution: Scientific, Ubuntu, Fedora
Posts: 373

Original Poster
Rep: Reputation: 43
Yeah $TZ gives a blank line.

Date gives

Code:
Tue Aug 17 22:13:59 BST 2010

Which would be fine, but its not 22:13, it's 23:13! I notice though that it is saying BST, although there is no such option in timeconfig.
 
Old 08-17-2010, 05:41 PM   #9
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
I assume that you have the time zone set to GB; I'm in the Central time zone, and my date command will give CDT for Central Daylight Time.

So what do you get when you issue the command
Code:
/sbin/hwclock -r && date
?

I get something like...
Code:
flacy@flacy:~$ /sbin/hwclock -r && date
Tue 17 Aug 2010 05:38:54 PM CDT  -0.687922 seconds
Tue Aug 17 17:38:54 CDT 2010
I'm just trying to see if your hardware clock and kernel time agree. If they do, then we can try to manually set them both and then you can do whatever it is that triggers the "they are now off" behavior.
 
Old 08-17-2010, 05:46 PM   #10
spoovy
Member
 
Registered: Feb 2010
Location: London, UK
Distribution: Scientific, Ubuntu, Fedora
Posts: 373

Original Poster
Rep: Reputation: 43
Code:
Tue 17 Aug 2010 10:42:57 PM BST  -0.123602 seconds
Tue Aug 17 22:42:57 BST 2010
Looks like there is a problem then?
 
Old 08-17-2010, 05:59 PM   #11
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
No, those are the same time. (22:42:57 is 10:42:57 PM)

So, just set the kernel date with the "date" command and issue...

Code:
hwclock --set --date=`date +"%D %T"`
...to make them both the same. (The hwclock command line is untested, but should work according to the man page.)

We can test that by running the
Code:
/sbin/hwclock -r && date
command again.
 
Old 08-18-2010, 01:40 PM   #12
spoovy
Member
 
Registered: Feb 2010
Location: London, UK
Distribution: Scientific, Ubuntu, Fedora
Posts: 373

Original Poster
Rep: Reputation: 43
Richard, I think I have solved this (before reading your last post), though I don't know how it works exactly.

I dual boot with Ubuntu on this laptop and suspected this may be something to do with it. Booting into Ubuntu I found that it was set to Local, London time. I changed that to UTC, GB time. Rebooting into Slackware it is now correct, set to UTC, GB time.

Thanks for your help anyway it is much appreciated, i'm sure we would've got there in the end

spoov
 
Old 08-18-2010, 02:00 PM   #13
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
No problem. Don't forget to mark the thread [SOLVED].

I suspect that if you ensure both Ubuntu and Slackware have working ntp configurations, then even if both distributions had a different idea of what was stored in the hardware clock, you would not really notice the problem. (I know Slackware starts the ntp daemon with the permission to change the clock as much as required to get it in line with the ntp server information. I'm sure Ubuntu does the same.)
 
  


Reply



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
how to set and sync system time with time server?? servnov Linux - Newbie 6 12-03-2013 07:55 PM
Time skew of 580 min when I set my time zone in Gentoo scooter2 Linux - Newbie 1 03-05-2009 10:27 AM
Where does RH8 daily set system time to hardware clock time smartnorman Red Hat 1 05-24-2006 02:42 PM
Cannot set time/date to other time zone than UTC (Kubuntu) jamangold Ubuntu 1 12-23-2005 05:42 PM
Doub about `net time set` and daylight saving time Thakowbbery Linux - Software 0 10-17-2005 05:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:37 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
Open Source Consulting | Domain Registration