PDA

View Full Version : Resetting clock local time.



E-Tramp
01-23-2013, 12:49 AM
OK, I have tried repeatedly to reset my clock on my machine in Knoppix and cannot find anything that isn't dated and doesn't seem to work. I know that it has got to be fairly simple, but, can't find the right proceedure.

Currently my clock is like 8 hours out of sync with the actual time(US, Pacific), and I have a 24 hour clock and want a Twelve.

So, what is the proceedure for resetting the clock permanantly?

Thanks.

E-Tramp
01-25-2013, 08:25 AM
Alright, I am a little disappointed that someone didn't post a process here, but, I ended up figuring it out myself, so since I couldn't find anywhere on the internet that gave a detailed step by step process for doing this I will put it here for others who want to know. I found on the internet that Ubuntu uses the command 'tzselect'. I thought what the heck plug it in and see if it works. In Ubuntu it had to be led with '~$', however that wouldn't work in Debian. So I just input 'tzselect' in terminal and wahlah, it asked me for what continent or ocean? The correct response was #2, or Americas, then it asked what country, which was #49 or United States, and finally which time zone, which was #22 or Pacific. Unfortunately this does not permanantly establish the time zone on the computer. But, what it does do is give you the information to make it permanant. It reads as follows: "The following information has been given: United States Pacific Time Therefore TZ='America/Los_Angeles' will be used. Local Time is now: Thu Jan 24 11:13:15 PST 2013 Universal Time is now: Thu Jan 24 11:13:15 UTC 2013 Is the above information OK? #1yes #2No #1 (enter) You can make this change permanant for yourself by appending the Line TZ='America/Los_Angeles'; export TZ to the file '.profile' in your home directory: then Log out and Log in again. Now the first thing you will find is that when you go to your "home" folder that it has nothing in it but the Knoppix folder. And if you try to put anything in it you will be told you don't have permissions to do so. The reason being is when they say your "home" folder what they really mean is your "Knoppix" folder that the system actually defaults to anyway. In that folder you will find a multitude of "Dot" folders and files of various titles, but, the one thing you won't find is one called ".profile". What you do now is you create said file with leafpad, and put it in the Knoppix folder. Now you are probably tempted to just log out to the log in screen then log back in, don't bother it didn't work for me. Just reboot your System and it will come back in Local time. The one thing I didn't find was a way to change to a 12 hour clock. This may require an application. I don't know for sure. Hope this saves a whole lot of people the trouble that I had getting this done. E-Tramp Posts: 4 Joined: 2013-01-24 00:32


--------------------------
Please use the "Go Advanced" button to have more abilities to format the posting; before sending your posting use "Preview" to see how it looks like.
wps

Werner P. Schulz
01-25-2013, 09:54 AM
If you have a flash disk install, use the Cheatcode (http://knoppix.net/wiki/Cheat_Codes) "tz=..." and make it permanent with Micro-Remastering (http://knoppix.net/wiki/Cheat_Codes#Micro-Remastering)? With harddrive install of Knoppix you have to edit '/boot/grub/menu.lst' and there in the kernel-line at position "tz=..."

By the way: Home-folder is always the folder of the current user. Knoppix has only the user "knoppix" (and "root"). Therefore the home-folder of the user knoppix is '/home/knoppix/'.

rajibando
01-25-2013, 02:25 PM
What I did was this:
I boot using knoppix cloop file. I activated the persistent boot. I have installed ntpdate using aptitude. I activated some reputed ntp servers around the world. Then from start menu>preferences>time and date and set time to Asia/Kolkata. The time and date is automatically updated.
However, every time I boot the time is reset to that of the USA, although there is an option to lock the settings, "Click to prevent changes".
Have I drawn the attention of the seniors!?

rajibando
01-25-2013, 03:20 PM
Also please note that the localisation by using KDE System Settings remains stored with reboot. Localisation set to India. But time and date issue isn't resolved, even with E-Tramp's method.

E-Tramp
01-26-2013, 11:13 AM
To us newbs, if you tell us go to the home folder and you have a folder named "home" we are automatically going to assume that is the folder you are talking about. As for Raji, if I may call you that, I am not sure what you mean about it not being resolved, but, at least when I look at the clock now I don't see Universal Time, I see Pacific Standard Time and that was what mattered. I would still like it to be a twelve hour clock though, because I haven't used a 24 hour clock since me and the Marines parted company in '77. Sounds like you might have a better setup there if it gives you more options. I might still have a problem when we hit Daylight Savings time, don't know if the time and date server this is coming from ever changes in that regard, because it does say "Universal Time", but, for now, however,it is the right time for where I am at.

E-Tramp
01-26-2013, 11:19 AM
And by the way, I think that what they mean by "Universal Time" is what we use to call "Greenwich Mean Time" set by a the clocks in Greenwich England. That is the time that aircraft around the world fly by. I could be wrong, but, it is the only "Universal Time I ever heard of.

rajibando
01-26-2013, 01:23 PM
To us newbs, if you tell us go to the home folder and you have a folder named "home" we are automatically going to assume that is the folder you are talking about. As for Raji, if I may call you that, I am not sure what you mean about it not being resolved, but, at least when I look at the clock now I don't see Universal Time, I see Pacific Standard Time and that was what mattered. I would still like it to be a twelve hour clock though, because I haven't used a 24 hour clock since me and the Marines parted company in '77. Sounds like you might have a better setup there if it gives you more options. I might still have a problem when we hit Daylight Savings time, don't know if the time and date server this is coming from ever changes in that regard, because it does say "Universal Time", but, for now, however,it is the right time for where I am at.
167
As I'd said, I installed ntp, ntpdate, etc., and then used this application to set date time. But whatever I set is undone the next time I boot. But the localisation I set remains as of India between powerdown and powerup.

Werner P. Schulz
01-26-2013, 05:39 PM
Set BIOS time to UTC (= Greenwich Time)
Edit "tz=..." (my posting #3)
right-mouse-click on the clock in the panel


168


read the man-page strftime
edit the string from "Clock Format" as you need

Werner P. Schulz
01-26-2013, 05:49 PM
I might still have a problem when we hit Daylight Savings time, ...If you follow my description, you'll always have the correct time. The time is calculated by the instructions you can see in the files of '/usr/share/zoneinfo/'.

rajibando
01-27-2013, 03:45 AM
Set BIOS time to UTC (= Greenwich Time)
Edit "tz=..." (my posting #3)
right-mouse-click on the clock in the panel


...


read the man-page strftime
edit the string from "Clock Format" as you need



Not feasible, since I already have a Debian 6.0.3 system, it resets the bios according to my localisation values set there, aided by ntpdate. So you have to please suggest another alternative. I have tried TZ cheatcode but that does not work either. I had also run tzselect (=asia/kolkata) here in knoppix, but that too does not work.

rajibando
01-27-2013, 03:56 AM
The process I am trying to implement is the most logical and generalised one, so please suggest something along the line.

E-Tramp
01-27-2013, 07:09 AM
Well, I will read up on it and see what you are talking about. Thanks for all of the help. I still have a lot to learn, so, and time to learn it. Wish I had more time to spend reading this stuff, but, I have to do other things too. I really haven't figured out the Micro Re-Mastering, but, I suppose I will eventually. I will be posting other issues as well.

Werner P. Schulz
01-27-2013, 10:32 AM
The UNIX/ LINUX way is:


always BIOS time = UTC

With Debian I use the crontab:

40 10,15,20 * * * /usr/sbin/ntpdate -v de.pool.ntp.org; /sbin/hwclock -u --systohc
With dual boot Windows installation you have to register:


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\↲
Services\W32Time\TimeProviders\NtpClient]
"SpecialPollInterval"=dword:00000e10

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\↲
CurrentVersion\DateTime\Servers]
@="1"
"1"="de.pool.ntp.org"
"2"="time.nist.gov"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\↲
TimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001

rajibando
01-27-2013, 12:58 PM
Why configure crontab? My system automatically updates the time when I log in to the internet. The ntpdate client listens to the network time servers by itself.
I don't use windoze, so I would not be interested in its registry codes.
Okay, this is one thing that we have got to look into in Knoppix.:)
But that the BIOS is updated by ntpdate is absolutely confirmed. In doze, if you change time the BIOS time is affected too.

Werner P. Schulz
01-27-2013, 07:27 PM
Why configure crontab?Why not?
But that the BIOS is updated by ntpdate is absolutely confirmed.Why do you think so? From man ntpdate:
ntpdate sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the server arguments to determine the correct time.

utu
01-27-2013, 11:35 PM
.
I have a nice Dell laptop which came equipped with Windows 7.
I rarely use Windows 7, but it allows the laptop to be very close
to 'Observatory time' since it syncs up my hardware clock with an
ntp server every time it IS used. I also corrects for daylight
savings time, if allowed a peek at the internet. The hardware
clock in question is set to local Eastern US time. I also set
my Knoppix desktop to local 12-hour am/pm format.

I don't use ntpdate or any other Knoppix time correction.
The consequences of this are two as far as I can tell.
1. The result of a date command will erroneously append UTC to
the otherwise very nearly correct local time.
2. There is a small error, currently about 15 seconds, which I
observe by occasionally checking against the USNO.
See: http://tycho.usno.navy.mil/simpletime.html.

If I wanted to tweak the small error, I could spend a few
minutes with Window 7.
If I wanted to tweak the erroneous UTC, I could use an alias
date="date | sed 's\UTC\EST\'" or date="date | sed 's\UTC\EDT\'"

I rarely find the need to do either.
Nor do I care to disturb my Windows 7 which works ok for what it is.

rajibando
01-28-2013, 02:02 AM
Why not?Why do you think so? From man ntpdate:

Because I have seen that happening with my BIOS :) Let us not be hasty. We can solve this issue universally if we think hard.

rajibando
01-28-2013, 08:18 AM
Because I have seen that happening with my BIOS :) Let us not be hasty. We can solve this issue universally if we think hard.
I am sorry, I should have been more elaborate. Actually, I have a localised system, as explained earlier. ntpdate sends that process the ntp data( time and date), and it localises the date time according to my settings(Asia/Kolkata) and rewrites the BIOS on that basis.

Werner P. Schulz
01-28-2013, 08:48 AM
Please tell us the output from
cat /proc/driver/rtc; date


from Debian
from Knoppix

My values are with Debian

rtc_time : 07:38:25
rtc_date : 2013-01-28
alrm_time : 00:00:00
alrm_date : ****-**-**
alarm_IRQ : no
alrm_pending : no
24hr : yes
periodic_IRQ : no
update_IRQ : no
HPET_emulated : yes
DST_enable : no
periodic_freq : 1024
batt_status : okay
Mo 28. Jan 08:38:25 CET 2013with Knoppix
cat /proc/driver/rtc; date
rtc_time : 07:41:11
rtc_date : 2013-01-28
alrm_time : 00:00:00
alrm_date : 2013-01-29
alarm_IRQ : no
alrm_pending : no
update IRQ enabled : no
periodic IRQ enabled : no
periodic IRQ frequency : 1024
max user IRQ frequency : 64
24hr : yes
periodic_IRQ : no
update_IRQ : no
HPET_emulated : no
BCD : yes
DST_enable : no
periodic_freq : 1024
batt_status : okay
Mon Jan 28 08:41:11 CET 2013Timezone for me is "Europe/Berlin"

Werner P. Schulz
01-28-2013, 10:26 PM
With Debian I use the crontab:

40 10,15,20 * * * /usr/sbin/ntpdate -v de.pool.ntp.org; /sbin/hwclock -u --systohc I've read Sysadmin time (http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html) again and now found this hint:
At least from Debian version 2.2 onwards, the system automatically saves the system time to hardware clock on shutdown, and sets the system clock from hardware clock when Debian boots up. This is done in the script /etc/init.d/hwclock.sh. Therefore I changed my crontab-entry within Debian to
40 10,15,20 * * * /usr/sbin/ntpdate -v de.pool.ntp.org

rajibando
01-29-2013, 03:56 AM
Please tell us the output from
cat /proc/driver/rtc; date


This one is from the Knoppix system: cat /proc/driver/rtc; date rtc_time : 08:14:09
rtc_date : 2013-01-29
alrm_time : 00:00:00
alrm_date : 2013-01-30
alarm_IRQ : no
alrm_pending : no
update IRQ enabled : no
periodic IRQ enabled : no
periodic IRQ frequency : 1024
max user IRQ frequency : 64
24hr : yes
periodic_IRQ : no
update_IRQ : no
HPET_emulated : yes
BCD : yes
DST_enable : no
periodic_freq : 1024
batt_status : okay
Mon Jan 28 21:44:09 EST 2013

rajibando
01-29-2013, 04:16 AM
For my Debian system:
rtc_time : 08:43:18
rtc_date : 2013-01-29
alrm_time : 00:00:00
alrm_date : ****-**-**
alarm_IRQ : no
alrm_pending : no
24hr : yes
periodic_IRQ : no
update_IRQ : no
HPET_emulated : yes
DST_enable : no
periodic_freq : 1024
batt_status : okay
Tue Jan 29 08:43:18 IST 2013

Werner P. Schulz
01-29-2013, 08:35 AM
This one is from the Knoppix system: cat /proc/driver/rtc; date rtc_time : 08:14:09 This value is wrong; did you write it manually? Now, what's the output from
cat /etc/timezonewithin your Debian and Knoppix?

rajibando
01-29-2013, 10:10 AM
This value is wrong; did you write it manually?
No, I pasted without putting a line break between the code and output (i.e., Enter Key) :)


This value is wrong; did you write it manually? Now, what's the output from
cat /etc/timezonewithin your Debian and Knoppix?

This part is already settled (please remember to visit my earlier posts). My debian setting is Asia/Kolkata.
My knoppix setting resets itself to the settings for usa after every boot:

What I did was ... every time I boot the time is reset to that of the USA, ...
and

... I installed ntp, ntpdate, etc., and then used this application to set date time. But whatever I set is undone the next time I boot...the localisation I set remains as of India between powerdown and powerup.

rajibando
01-29-2013, 10:45 AM
To be precise, the Knoppix time is:
knoppix@Microknoppix:~$ cat /etc/timezone Output:
America/New_York

rajibando
01-29-2013, 11:07 AM
The problem lies with the package: time-admin It can't store date-time settings, at least in my copy of Knoppix.

Werner P. Schulz
01-29-2013, 12:51 PM
Oh, no! "time-admin" can store your settings and you can see it immediatly with "cat /etc/timezone". But Knoppix is a Live System and therefore it uses another way => '/etc/init.d/knoppix-autoconfig' => '# Set timezone'

Knoppix uses only the value of "tz=..." of the Kernel line and other settings within "/etc/timezone" will be overwritten.

rajibando
01-29-2013, 02:21 PM
The problem lies with the package: time-admin It can't store date-time settings, at least in my copy of Knoppix.
What I meant was in between shutdown and booting.
You say,
Knoppix uses only the value of "tz=..." of the Kernel line and other settings within "/etc/timezone" will be overwritten.
I have tested with tz in the kernel line, but knoppix does not use that in the subsequent boots. Remember my posting,
... I have tried TZ cheatcode but that does not work either. I had also run tzselect (=asia/kolkata) here in knoppix, but that too does not work.
What it does is it treats my BIOS time as UTC and then calculates New York time. You say,
Oh, no! "time-admin" can store your settings and you can see it immediatly with "cat /etc/timezone" But Knoppix is a Live System and therefore it uses another way => '/etc/init.d/knoppix-autoconfig' => '# Set timezone'

Where is this line? My kernel line is:
linux (hd1,1)/boot/isolinux/linux root=/dev/ram rw ramdisk_size=100000 lang=us apm=power-off nomce tz=/Asia/Kolkata

rajibando
01-29-2013, 02:55 PM
Yes, done! The error was in using the capital TZ, following earlier post. whereas it would be tz in kernel line, and then using the ntp daemon to fix the time and date. Thanks for staying on the issue with me.

rajibando
02-01-2013, 03:02 AM
Knoppix...uses another way => '/etc/init.d/knoppix-autoconfig' => '# Set timezone'

Please elaborate!
Regards