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 |
What version Slackware?
What does Code:
ls -l /etc/localtime-copied-from Do the two commands Code:
sha1sum /etc/localtime-copied-from |
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 |
Richard -
13.1 Code:
lrwxrwxrwx 1 root root 23 2010-08-17 16:35 /etc/localtime-copied-from -> /usr/share/zoneinfo/GMT 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) |
Quote:
Do you guys do the daylight savings time thing? If so, there is your hour difference: GMT never does DST. |
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?? |
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 Code:
date |
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. |
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 |
Code:
Tue 17 Aug 2010 10:42:57 PM BST -0.123602 seconds |
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"` We can test that by running the Code:
/sbin/hwclock -r && date |
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 |
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.) |
All times are GMT -5. The time now is 06:03 AM. |