PDA

View Full Version : Another Time Setting question



gideon_friedmann
13-03-2005, 06:17 AM
I have read the many posts about how to change the TiVo time, but I got very confused. My question is simple. I am in Israel and don't care about the program guide. I just want to set the time to my local time (GMT+2). Is there a simple way to do it (that does not reset after the daily call)?

I did stumble on a text file in the Tivo a while ago, where there was a timezone parameter that I changed from 7 to 8 (OZ tivo image), and this seems to have moved me back one hour. I can't seem to find this file any more. Anybody knows?

Thanks,

Gideon

thomson
13-03-2005, 07:46 AM
I did stumble on a text file in the Tivo a while ago, where there was a timezone parameter that I changed from 7 to 8 (OZ tivo image), and this seems to have moved me back one hour. I can't seem to find this file any more. Anybody knows?

You are probably talking about the "timezoneadj30.tcl" script which should be located in the /hack/bin directory. This should be enough to correct the time, but if it is not then you could synchronise from an NTP system with something like the "fixtivotime" script (also located in /hack/bin). You may also like to just try set it at GMT (7) and then just change the time using the "date MMDDhhmm" command (followed by "settime -rtc").

gideon_friedmann
13-03-2005, 09:14 PM
Thanks.

No, it was not the timezoneadj30.tcl.
However, I tried to run that. For some reason it does not take the number I put in from the screen (I did a "puts" and the variable is empty. I am using Putty in telnet mode). So I just set the tzNew variable to what I wanted within the script (9 according to the instructions).
This produced a change of one hour for some reason. I tried a couple of other values (e.g. 1), and I got different times. However, the Tivo did its daily call at some point, and all the work was gone. It was back to the original Sydney time.
Here is the output from the fixtivotime program
Our postcode is 02000. Found matching timezone Australia/Sydney
Offset 39600 for timezone EST, daylight saving is 1
Connecting to time server 207.126.98.204
t was 3319700069 from server
t is now 1110750869
Time is 2005-03-13 21:54:29
Time set to: Sun Mar 13 21:54:29 2005
Have a nice day.
Time set to: Sun Mar 13 21:54:30 2005
Have a nice day.

Perhaps there is a simple way to create another timezone file? Or maybe someone made files for every timezone around the globe? Or maybe there is an elegant way to change the offset?
It is so frustrating that such a simple issue is made so complex, and I am wasting hours on it.

Thanks,

Gideon.

zollymonsta
14-03-2005, 08:02 AM
Hi Gideon,

Do you have access to a linux box?

If so, you could copy a timezone file for your area off it (if it has one)
and ftp it across to your TiVo.

Then change the timzones file (so that the TiVo uses your timezone file to
set the time).

I did this originally on my TiVO so it would use the 'Auckland' timezone file for New Zealand Time.

Worked perfect.


ZollyMonsta

thomson
14-03-2005, 09:20 AM
I am not sure why you are doing a daily call to the emulator as this seems to be what is causing most of your problems? I think you can stop the TiVo using the emulator by commenting out the entry in the tclient.conf? But am not sure of this.

The attached program will allow you to set your time from an NTP system.

There are many ways of executing it. By adding an ‘–s’ it will set both the hardware (CMOS) and the software (O/S) time on the TiVo. If the '-s' option is not used, then it will output the time in a format that is suitable for use by settime (to remain compatable with rtimetz).

Example 1
The following will lookup the postalcode in the database and then lookup your timezone in the /etc/postcodezones file and using that information attempt to find the timezone information by looking in /var/hack/zoneinfo.



# rdate –v 207.126.98.204 129.6.15.28 131.107.1.10
# rdate –vs 207.126.98.204 129.6.15.28 131.107.1.10


Example 2
The following does not require the /etc/postcodezones file as we have specified which timezone to use, it will look in TZDIR for the information files (TZDIR defaults to /var/hack/zoneinfo).



# TZ=Israel rdate –v 207.126.98.204 129.6.15.28
# TZ=Israel rdate –vs 207.126.98.204 129.6.15.28


Example 3
The following tells the application the exact location of the zoneinfo file (take note of the the colon ':'), thus allowing you to place the zoneinfo file where-ever you wish.



# TZ=:/var/hack/zoneinfo/Israel rdate –v 207.126.98.204
# TZ=:/var/hack/zoneinfo/Israel rdate –vs 207.126.98.204



QUICK INSTALLATION FOR ISRAEL USERS



1. Make the rdate program executable

# chmod 755 rdate

2. Move it into the /var/hack/bin directory

# mv rdate /var/hack/bin

3. Create a directory to hold the "Israel" zoneinfo file

# mkdir -p /var/hack/zoneinfo

4. Move the provided "Israel" zoneinfo file into this directory

# mv Israel /var/hack/zoneinfo

5. Run the command and check that things look okay

# TZ=Israel rdate –v 207.126.98.204

6. Run the command with the "set" (-s) option to change the date/time

# TZ=Israel rdate –vs 207.126.98.204

gideon_friedmann
14-03-2005, 11:19 PM
Thanks so much for the Israel timezone file !!
I created an Israel directory in the zoneinfo directory and copied the Israel file into it. After that I changed the pointer in the postcodezones for my zip code (02000) to Israel/Israel
This seems to have worked, and survived a daily call.
Of course I don't need the daily calls, but the TiVo keeps nagging quite badly if no calls are made.

For the next release perhaps a generic directory of all 24 timezones should be added to the zoneinfo directory, and all the people who have trouble with the time will just point to the file they want (or a script could do that). Would be much simpler than all the long explanations I read).
Is it easy to create such a file as zollymonsta has hinted (is it available in any standard Linux installation? I have such a CD, which I could start my PC with).
Now of course I have the daylight savings time issue to tackle... Of course I am about the opposite of australia - so right now I am one hour ahead of the real time here, and will be one hour back when the times change (here and in Australia). Any ideas?
I am also willing to just install 2 more timezone files (GMT+3 and GMT+1) in my system and change the pointer to them twice yearly.

Thanks again,

Gideon.

thomson
15-03-2005, 10:04 AM
I am also willing to just install 2 more timezone files (GMT+3 and GMT+1) in my system and change the pointer to them twice yearly.

Any Unix/Linux timezone file should be DST aware.


"The problem is that until 2005, the exact date the changes occured was decided every year by the Ministry of Interior. There was no set rule for Daylight-Saving/Standard time changes. The only given was that there had to be at least 150 days of daylight saving time annually. From 1993-1998, the change to daylight saving time was on a Friday morning from midnight IST to 1 a.m IDT; up until 1998, the change back to standard time was on a Saturday night from midnight daylight saving time to 11 p.m. standard time. 1996 is an exception to this rule where the change back to standard time took place on Sunday night instead of Saturday night to avoid conflicts with the Jewish New Year. From 1999-2004, the change to daylight saving time was on a Friday morning, but from 2 a.m. IST to 3 a.m. IDT; and the change back to standard time was on a Friday morning from 2 a.m. IDT to 1 a.m. IST."


So things are a little up in the air... the following are the Daylight Saving transitions for the next three years encoded in the Israel file that I provided. For example at 1am on the first of April the time will jump to 2am, and at 1am on the first of October the time will jump back to midnight (I think I have this the right way around). This does not seem correct for this year as Daylight savings should end on October the 9th... but it should still be okay up until that date.


Israel Thu Mar 31 22:59:59 2005 UTC = Fri Apr 1 00:59:59 2005 IST isdst=0 gmtoff=7200
Israel Thu Mar 31 23:00:00 2005 UTC = Fri Apr 1 02:00:00 2005 IDT isdst=1 gmtoff=10800
Israel Fri Sep 30 21:59:59 2005 UTC = Sat Oct 1 00:59:59 2005 IDT isdst=1 gmtoff=10800
Israel Fri Sep 30 22:00:00 2005 UTC = Sat Oct 1 00:00:00 2005 IST isdst=0 gmtoff=7200
Israel Fri Mar 31 22:59:59 2006 UTC = Sat Apr 1 00:59:59 2006 IST isdst=0 gmtoff=7200
Israel Fri Mar 31 23:00:00 2006 UTC = Sat Apr 1 02:00:00 2006 IDT isdst=1 gmtoff=10800
Israel Sat Sep 30 21:59:59 2006 UTC = Sun Oct 1 00:59:59 2006 IDT isdst=1 gmtoff=10800
Israel Sat Sep 30 22:00:00 2006 UTC = Sun Oct 1 00:00:00 2006 IST isdst=0 gmtoff=7200
Israel Sat Mar 31 22:59:59 2007 UTC = Sun Apr 1 00:59:59 2007 IST isdst=0 gmtoff=7200
Israel Sat Mar 31 23:00:00 2007 UTC = Sun Apr 1 02:00:00 2007 IDT isdst=1 gmtoff=10800
Israel Sun Sep 30 21:59:59 2007 UTC = Mon Oct 1 00:59:59 2007 IDT isdst=1 gmtoff=10800
Israel Sun Sep 30 22:00:00 2007 UTC = Mon Oct 1 00:00:00 2007 IST isdst=0 gmtoff=7200

thomson
15-03-2005, 10:27 AM
The proposed law agreed upon by the Knesset Interior Committee a month ago (2005-02-14) is that, for 2005 and beyond, DST starts at 02:00 the last Friday before April 2nd (i.e. the last Friday in March or April 1st itself if it falls on a Friday) and ends at 02:00 on the Saturday night before the fast of Yom Kippur.

The attached "Israel" zoneinfo file reflects these changes. The following are an extract of the next three years adjustments:


Israel Thu Mar 31 23:59:59 2005 UTC = Fri Apr 1 01:59:59 2005 IST isdst=0 gmtoff=7200
Israel Fri Apr 1 00:00:00 2005 UTC = Fri Apr 1 03:00:00 2005 IDT isdst=1 gmtoff=10800
Israel Sat Oct 8 22:59:59 2005 UTC = Sun Oct 9 01:59:59 2005 IDT isdst=1 gmtoff=10800
Israel Sat Oct 8 23:00:00 2005 UTC = Sun Oct 9 01:00:00 2005 IST isdst=0 gmtoff=7200
Israel Thu Mar 30 23:59:59 2006 UTC = Fri Mar 31 01:59:59 2006 IST isdst=0 gmtoff=7200
Israel Fri Mar 31 00:00:00 2006 UTC = Fri Mar 31 03:00:00 2006 IDT isdst=1 gmtoff=10800
Israel Sat Sep 30 22:59:59 2006 UTC = Sun Oct 1 01:59:59 2006 IDT isdst=1 gmtoff=10800
Israel Sat Sep 30 23:00:00 2006 UTC = Sun Oct 1 01:00:00 2006 IST isdst=0 gmtoff=7200
Israel Thu Mar 29 23:59:59 2007 UTC = Fri Mar 30 01:59:59 2007 IST isdst=0 gmtoff=7200
Israel Fri Mar 30 00:00:00 2007 UTC = Fri Mar 30 03:00:00 2007 IDT isdst=1 gmtoff=10800
Israel Sat Sep 15 22:59:59 2007 UTC = Sun Sep 16 01:59:59 2007 IDT isdst=1 gmtoff=10800
Israel Sat Sep 15 23:00:00 2007 UTC = Sun Sep 16 01:00:00 2007 IST isdst=0 gmtoff=7200

gideon_friedmann
15-03-2005, 09:16 PM
I am much impressed by your detailed knowledge! Most Israelis are not aware of all of this!
Because of all the complications, I was not even going to suggest automation of the time change process...
I will load the file to the TiVo.... Done.
How to you turn the ASCII file to a zoneinfo binary file ?

Now I am a bit bewildered by the time the Tivo displays.
(Using telnet to the TiVo) the date command gives me the correct time and date. When I run the fixtivotime script it reports daylight savings is set to 0. (I also set it to 0 when I ran guided setup). However in the TiVo User Interface, when I ask for system information the time is displayed one hour ahead (as if DST is on). I figured this is because in Australia DST is on now, and this parameter is hidden somewhere. You claim however that it is only hidden in the zoneinfo files, and I am no longer using the australian zoneinfo file.
So the question why does the TiVo move one hour forward, and how to correct it.

Thanks again,

Gideon

thomson
16-03-2005, 08:01 AM
How to you turn the ASCII file to a zoneinfo binary file ?
The tools used are zic(8) which stands for Zone Info Compiler and the reverse one is zdump(8) which stands for Zone Dumper. Most Unix based systems should have these utilities.


Now I am a bit bewildered by the time the Tivo displays. (Using telnet to the TiVo) the date command gives me the correct time and date. When I run the fixtivotime script it reports daylight savings is set to 0. (I also set it to 0 when I ran guided setup). However in the TiVo User Interface, when I ask for system information the time is displayed one hour ahead (as if DST is on). I figured this is because in Australia DST is on now, and this parameter is hidden somewhere. You claim however that it is only hidden in the zoneinfo files, and I am no longer using the australian zoneinfo file.
So the question why does the TiVo move one hour forward, and how to correct it.


Okay... I doubt that I would be running the fixtivotime script... you probably want to use the rdate command I created as it deals with timezones in a much nicer way.

Anyway, you probably want to check that you are running the TiVo in GMT/UCT by setting the timezone to 7 and turning off the Daylight Saving policy (essentially this just means running timezoneadj30.tcl and choosing 7). You can check that this is the case by using TivoWeb and browsing to /State/LocationConfig using the MFS module (http://ip-address-of-tivo/mfs/State/LocationConfig). You should see and entry containing the following:


TimeZoneOld = 7
DaylightSavingsPolicy = 0


This gives you more management over the time of the TiVo as we can now fully manage the timezone ourselves. Of course an alternative would be to get the TiVo to recognise the new zoneinfo file, etc... but as the AUS/NZ crowd all run their units in GMT it is probably better to stick to this approach to keep things less complex.

Once you have things sorted, it should just be a matter of running something like rdate at 3am every morning via cron (what this does is take the time from the internet - adjust it for Israel - and set the time (in GMT) of the TiVo).

gideon_friedmann
16-03-2005, 11:43 PM
OK.
I ran the timezoneadj.tcl and adjusted the timezone to 7 (it reported that it was 8 and adjusted to 7).
Now all looks splendid.
When the system reboots the timezoneold reverts to 8. Now, as I alluded to in the original post (way up there...), I changed (probably) this timezoneold to 8 at some point, but I cannot remember in which file. Can you point me to this file (alternatively, how do I change this parameter permanently).

Thanks

Gideon.

thomson
17-03-2005, 05:59 AM
I ran the timezoneadj30.tcl and adjusted the timezone to 7 (it reported that it was 8 and adjusted to 7).
Now all looks splendid.
When the system reboots the timezoneold reverts to 8. Now, as I alluded to in the original post (way up there...), I changed (probably) this timezoneold to 8 at some point, but I cannot remember in which file.

Sorry, other than timezoneadj30.tcl I am not aware of anything else that would reset this value... Needless to say it should not be resetting on restartup :(

gideon_friedmann
17-03-2005, 11:40 PM
I found the file...
rc.sysinit.tivohack sets the timezone. Apparently it is run on every boot.
It is towards the end of the file, and I stumbled upon it when playing with the dial prefix. I then changed it to 8 in the thought that it was some sort of offset, and that I would figure out the correct offset to get the time correctly to Israel. I later forgot which file it was...
I changed the value back to 7 (GMT).
So, now I have the time set to local time, and hopefully, (and this was only possible with your masterful help for which I am grateful), it will keep so even during local daylight savings changes.

Thanks so much again,

Gideon