PDA

View Full Version : [Apple TV] Request ability to set Time-Zone from XBMC


yzeyze
2008-10-08, 13:09
This may not be specific to the ATV, not sure.....

But - how do I set the timezone now?
It used to be in the 'region' section of the settings on my xbox, but appears to be missing at the moment.....
My time is always showing GMT.

Wander2000
2008-10-08, 19:14
I just did a search on the board, and didn't find an answer either. I have the same problem. Not a big deal considering how easy this was to setup & use.

bob2009
2008-10-08, 19:45
HI,

I found this some times ago when i was using Mythfrontend.
Link: http://www.mythtv.org/wiki/index.php/Installing_MythFrontend_on_an_AppleTV

Fix the timezone

My AppleTV thought it was in Rome. If the timezone is wrong problems occur when scheduling recordings. To fix this add the following to /etc/rc.local (adjust as necessary for you location):

/bin/ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime

Either run the file or reboot for this to take effect.


Good luck
Bob

himik
2008-10-08, 19:50
1) slogin to your ATV
2) cd /etc
3) rm localtime
4) (for example)
ln -s /usr/share/zoneinfo/Europe/Moscow localtime
( studied /usr/share/zoneinfo catalog and give your zone.)
5) reboot ATV

Successes!

xeonicxpression
2008-10-09, 00:35
1) slogin to your ATV
2) cd /etc
3) rm localtime
4) (for example)
ln -s /usr/share/zoneinfo/Europe/Moscow localtime
( studied /usr/share/zoneinfo catalog and give your zone.)
5) reboot ATV

Successes!

Finally got it to work. For some reason it wasn't wanting to stick. I don't know what I was doing wrong, but now it shows the propper time. Tha was driving me crazy!

Wander2000
2008-10-10, 01:32
1) slogin to your ATV
2) cd /etc
3) rm localtime
4) (for example)
ln -s /usr/share/zoneinfo/Europe/Moscow localtime
( studied /usr/share/zoneinfo catalog and give your zone.)
5) reboot ATV

Successes!

Many thanks! :D

yzeyze
2008-10-10, 02:31
Thankyou, worked well.

KevinSartori
2008-10-20, 16:12
Hey! I searched for "AppleTV timezone" and found this post. I'm a new XBMC for AppleTV user, having just moved from Xbox. Could someone work up a simple tutorial for someone not familiar with the above commands? I would like to change my timezone to USA EST using WinSCP and/or PuTTY.

I'm sorry and I feel stupid, but as a Windows user, I just don't understand the directions above.

Thanks!

xeonicxpression
2008-10-21, 01:22
Well, I assume you know how to login to the Appletv so:
1) login to the appletv using putty
2) cd /usr/share/zoneinfo
3) type ls to see the listing of the folder. Find your local time zone. The US has another folder you have to go into as do other countries. Eastern time would be usr/share/zoneinfo/us/eastern .
4) cd /etc
5) sudo rm localtime
6) sudo ln -s /usr/share/zoneinfo/US/Eastern localtime (Just an example. So again, you need to make sure you have the path correct for your time zone.)
7) sudo shutdown -r now (that will reboot the appletv)

Edit: Changed the instructions to include sudo in the propper lines per Kevin's feedback. Hope this helps anyone that isn't familiar with OS X commands. Just remember, if you get permission denied, you need to add sudo. Also, I take no credit for this. I just expanded on himik's instructions.

KevinSartori
2008-10-21, 03:58
Thanks for the help, xeonicxpression! Your directions make sense, but I'm stuck at rm localtime. I get Permission denied. I looked up the rm command and learned that it means delete. So I launched WinSCP and tried to delete the file that way and received the following in an error box:

Error deleting file 'localtime'.
---------------------------
Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 13

I tried doing this both ways in the AppleTV menu and while running XBMC. I'm running Beta 2 on an Apple TV 2.2. Does anyone have any advice?

xeonicxpression
2008-10-21, 04:00
Did you put sudo infront of it? Try sudo rm localtime. If you can't get it to work I'll hook my appletv back up tomorrow and try it again.

KevinSartori
2008-10-21, 06:00
That worked, xeonicxpression! Thanks!

At first I got the dreaded Permission denied when I typed in ln -s /usr/share/zoneinfo/US/Eastern localtime, so I figured, "Hey, maybe I should add a 'sudo' to the beginning of this command also." So I tried:

sudo ln -s /usr/share/zoneinfo/US/Eastern localtime

It worked! The XBMC guys should really add a way to switch timezones in XMBC itself. There has to be other folks out there rolling through the settings menus trying to figure out a way to change the clock!

Thanks again!

xeonicxpression
2008-10-21, 07:40
Glad to hear you got it working. I'm with you. It would be nice if they could provide a way to change the time zone. I'm a windows user, so like you I had to try and figure out the commands. Heck, the hardest part was trying to reboot the appletv using the command line, lol. Incase you didn't know, sudo gives you root privileges. That is just like administrative rights on windows.

droc23
2008-11-09, 02:02
Thanks so much for this post everyone, saved me some configuration time.

Remember to type localtime when setting, I didn't, and in my case New York, time was set to Eastern, not Eastern local which is -5GMT

Thanks again for the post...very helpful

zedzed
2008-11-20, 03:24
I can't believe there is nothing in the Apple TV 2.2 settings that allows you to change your time. For me I am showing GMT time (Canada EST + 5 hours)

davilla
2008-11-20, 03:36
I can't believe there is nothing in the Apple TV 2.2 settings that allows you to change your time. For me I am showing GMT time (Canada EST + 5 hours)

So are you saying the suggestions in this thread are not working for AppleTV r2.2?

The native AppleTV OS and plugins have no need to show the time (zone) info so that's why there is no way to change it using the native plugins.

zedzed
2008-11-20, 05:02
davilla - my bad - after the help in this thread I was able to get the time fixed in XBMC

My comment was about no way to set the time in the actual ATV 2.2 settings but yeah I can see your point that there is no clock and time is never shown in the regular 2.2

Thanks again for your great work.

XBMC4Ever
2009-01-06, 04:02
Not to drag up all the joys of ATV time zone changing again, but I am hoping the developers might be able to offer some insight into this.

As per a previous post, I was having difficulty with this: http://xbmc.org/forum/showthread.php?t=40437&highlight=time+zone

The resolution was a nuke & pave + avoiding the use of my old "userdata" contents. But not being able to restore my userdata folder is frustrating.

Last night I upgraded our TV from a 720p model to a 1080p model.
Any attempts at switching the ATV to 1080p output mode locked everything up .. so .. nuke & pave.

A fresh un-patched ATV 2.3 was able to switch the output to 1080p fine, so then I PatchStick'd, downloaded Launcher 2.2, XBMC 8.10 bf1, and then I patched the time zone. All was OK until I restored my userdata folder from my backup. Time zone was broken again and no matter how many times I RM localtime, etc and reboot, XBMC always says I am GMT.

Is there a correlation between /etc/localtime and frontrow's userdata folder ?

davilla
2009-01-06, 04:38
Not to drag up all the joys of ATV time zone changing again, but I am hoping the developers might be able to offer some insight into this.

As per a previous post, I was having difficulty with this: http://xbmc.org/forum/showthread.php?t=40437&highlight=time+zone

The resolution was a nuke & pave + avoiding the use of my old "userdata" contents. But not being able to restore my userdata folder is frustrating.

Last night I upgraded our TV from a 720p model to a 1080p model.
Any attempts at switching the ATV to 1080p output mode locked everything up .. so .. nuke & pave.

A fresh un-patched ATV 2.3 was able to switch the output to 1080p fine, so then I PatchStick'd, downloaded Launcher 2.2, XBMC 8.10 bf1, and then I patched the time zone. All was OK until I restored my userdata folder from my backup. Time zone was broken again and no matter how many times I RM localtime, etc and reboot, XBMC always says I am GMT.

Is there a correlation between /etc/localtime and frontrow's userdata folder ?

First need to see if we have a system or xbmc problem.

ssh in and type "date". Is the timezone correct? "date" uses system settings. If this is wrong, then "/etc/localtime" might not be correct.

"ls -l /etc/localtime"

localtime should be a symlink to your timezone.

For example, for me "/etc/localtime -> /usr/share/zoneinfo/US/Eastern"

What does yours have?

abem3
2009-01-06, 05:22
Hmph... interesting that I'm having a similar issue...

Updated to 2.3 from 2.2... reloaded all my apps and restored my userdata folder!

Now this

-bash-2.05b$ date
Tue Jan 6 06:25:33 EST 2009
-bash-2.05b$ ls -al /etc/localtime
lrwxr-xr-x 1 root wheel 30 Jan 4 07:30 /etc/localtime -> /usr/share/zoneinfo/US/Eastern

And it is currently 10:22PM EST ..

davilla
2009-01-06, 05:39
Hmph... interesting that I'm having a similar issue...

Updated to 2.3 from 2.2... reloaded all my apps and restored my userdata folder!

Now this

-bash-2.05b$ date
Tue Jan 6 06:25:33 EST 2009
-bash-2.05b$ ls -al /etc/localtime
lrwxr-xr-x 1 root wheel 30 Jan 4 07:30 /etc/localtime -> /usr/share/zoneinfo/US/Eastern

And it is currently 10:22PM EST ..

wall clock time or XBMC time?

XBMC4Ever
2009-01-06, 05:42
First need to see if we have a system or xbmc problem.

ssh in and type "date". Is the timezone correct? "date" uses system settings. If this is wrong, then "/etc/localtime" might not be correct.

"ls -l /etc/localtime"

localtime should be a symlink to your timezone.

For example, for me "/etc/localtime -> /usr/share/zoneinfo/US/Eastern"

What does yours have?

zoneinfo is correct ... symlink is "/etc/localtime - /usr/share/zoneinfo/US/Pacific"

date command displays "Tue Jan 6 03:44:30 PST 2009" except it should say "Mon Jan 5 19:44:30 PST 2009"

based on that, I would go with a "system issue" since XBMC is displaying what the system has .. BUT .. why does a virgin nuke & pave without restore of userdata work OK ?

davilla
2009-01-06, 06:02
zoneinfo is correct ... symlink is "/etc/localtime - /usr/share/zoneinfo/US/Pacific"

date command displays "Tue Jan 6 03:44:30 PST 2009" except it should say "Mon Jan 5 19:44:30 PST 2009"

based on that, I would go with a "system issue" since XBMC is displaying what the system has .. BUT .. why does a virgin nuke & pave without restore of userdata work OK ?

not a clue but let's continue debugging the problem.

The AppleTV is using a ntp server to keep track of time. You can see this with "ps -ax | grep ntp". My returns the following:


103 ?? Ss 0:05.85 ntpd -f /var/run/ntp.drift -p /var/run/ntpd.pid


now try this

"sudo ntpdate -q time.apple.com"

ntpdate updates the time but it can't be done while ntpd is running. This command quires the time server but does not set the clock.

Do this command and post the result and what you think the time should be.

davilla
2009-01-06, 06:10
now to re-start the ntpd which will re-sync to a time server


sudo /System/Library/StartupItems/NetworkTime/NetworkTime restart


if you look at "/System/Library/StartupItems/NetworkTime/NetworkTime", it's a bash script that handles start/stop/restart command to ntpd

then "date" again to see if you are in sync now.

davilla
2009-01-06, 06:35
another fun command is


-bash-2.05b$ ntpq -p


remote refid st t when poll reach delay offset jitter
================================================== ============================
time5.apple.com 17.72.133.55 2 u 329 68m 1 238.091 -1.109 0.001


and


http://support.apple.com/kb/TA24116?viewlocale=en_US


has good info.

These should help track down time issues. If the system time is not correct, then XBMC can never be correct.

Things to remember, if the AppleTV cannot get to time.apple.com, then ntpd cannot keep the time in sync and will have to rely on the RTC. Time syncing is much more complicated that just talking to the server once.

XBMC4Ever
2009-01-06, 06:41
not a clue but let's continue debugging the problem.

The AppleTV is using a ntp server to keep track of time. You can see this with "ps -ax | grep ntp". My returns the following:


103 ?? Ss 0:05.85 ntpd -f /var/run/ntp.drift -p /var/run/ntpd.pid


now try this

"sudo ntpdate -q time.apple.com"

ntpdate updates the time but it can't be done while ntpd is running. This command quires the time server but does not set the clock.

Do this command and post the result and what you think the time should be.


now to re-start the ntpd which will re-sync to a time server


sudo /System/Library/StartupItems/NetworkTime/NetworkTime restart


if you look at "/System/Library/StartupItems/NetworkTime/NetworkTime", it's a bash script that handles start/stop/restart command to ntpd

then "date" again to see if you are in sync now.

rackin frackin jickin rickin

OK .. tried both ... but both result in "Looking for host time.apple.com and service ntp" ... and it sits there f-o-r-e-v-e-r :( until I Ctrl-C out of it.
Even tried re-enabled the Auto-Update for the ATV via Launcher 2.2 wondering if it was also looping the DNS lookup back to 127.0.0.1 but no joy.

Am I to assume that time.apple.com is down ? If I ping time.apple.com from my main system, it resolves to an IP but there is no response. Yet if I ping ntp1.dlink.com I get a full repsonse. <sigh>

I tried "sudo ntpdate -q ntp1.dlink.com" but it defaulted to time.apple.com ... so I assume we cannot choose alternate ntp servers ?
That would be nice if we change time servers.

After all this head-bangin' - it all comes back to Apple frackin' around ?
(or maybe some ISP somewhere killin' the link between here and there ?)
grrrr x 0~0 ... and somehow every time I nuke 'n pave, etc etc time.apple.com seems to be down at the same time.
How quaint !!! :)

davilla
2009-01-06, 06:55
rackin frackin jickin rickin

OK .. tried both ... but both result in "Looking for host time.apple.com and service ntp" ... and it sits there f-o-r-e-v-e-r :( until I Ctrl-C out of it.

Am I to assume that time.apple.com is down ? If I ping time.apple.com from my main system, it resolves to an IP but there is no response. Yet if I ping ntp1.dlink.com I get a full repsonse. <sigh>

I tried "sudo ntpdate -q ntp1.dlink.com" but it defaulted to time.apple.com ... so I assume we cannot choose alternate ntp servers ?

After all this head-bangin' - it all comes back to Apple frackin' around ?
(or maybe some ISP somewhere killin' the link between here and there ?)
grrrr x 0~0

time.apple.com is never down :) It's not "Apple frackin' around". Time servers are serious business. time.apple.com actually resolves to more than one time server at apple. These are stratum 2 time servers. Pretty high on the pecking order.

time.apple.com never responds to a ping, keeps the blackhat riff-raff out. It's pretty standard to turn off ping response from servers.


-bash-2.05b$ sudo ntpdate -q ntp1.dlink.com
Password:
Looking for host time.apple.com and service ntp
host found : time6.apple.com
Looking for host ntp1.dlink.com and service ntp
host found : ntp1.dlink.com
server 17.151.16.22, stratum 2, offset 17.955236, delay 0.26331
server 64.7.210.145, stratum 2, offset 17.957019, delay 0.25536
5 Jan 23:52:36 ntpdate[273]: step time server 64.7.210.145 offset 17.957019 sec


worked fine for me :) Smells like a network problem. Hard firewall blocking ntp ports maybe?

XBMC4Ever
2009-01-06, 07:33
time.apple.com is never down :) It's not "Apple frackin' around". Time servers are serious business. time.apple.com actually resolves to more than one time server at apple. These are stratum 2 time servers. Pretty high on the pecking order.

time.apple.com never responds to a ping, keeps the blackhat riff-raff out. It's pretty standard to turn off ping response from servers.


-bash-2.05b$ sudo ntpdate -q ntp1.dlink.com
Password:
Looking for host time.apple.com and service ntp
host found : time6.apple.com
Looking for host ntp1.dlink.com and service ntp
host found : ntp1.dlink.com
server 17.151.16.22, stratum 2, offset 17.955236, delay 0.26331
server 64.7.210.145, stratum 2, offset 17.957019, delay 0.25536
5 Jan 23:52:36 ntpdate[273]: step time server 64.7.210.145 offset 17.957019 sec


worked fine for me :) Smells like a network problem. Hard firewall blocking ntp ports maybe?

Well ... while you were carvin' my Apple peels, I went around to every device on my network (NAS, router, Tablet, Netbook, workstations) and set them all to sync with time.apple.com .. and they all did it quickly and perfectly.

Then, I went back to the ATV ... started a restart on the time service ... and by the time I got done my first paragraph, the ATV had updated properly. So ... (1) port issues ain't hap'nin (2) every other device hit time.apple.com like the wind; and (3) who knows why the ATV takes 4 times as long as every other wireless device to hookup with time.apple.com ...

Maybe I should email Mr Jobs and ask :cool:

And if there's any frackin' to frack about, maybe it's Shaw this time ... d'oh
Although the coincidence is still quite odd.

Many thanks for your assistance Cruella DaVilla :)

davilla
2009-01-06, 07:43
Well ... while you were carvin' my Apple peels, I went around to every device on my network (NAS, router, Tablet, Netbook, workstations) and set them all to sync with time.apple.com .. and they all did it quickly and perfectly.

Then, I went back to the ATV ... started a restart on the time service ... and by the time I got done my first paragraph, the ATV had updated properly. So ... (1) port issues ain't hap'nin (2) every other device hit time.apple.com like the wind; and (3) who knows why the ATV takes 4 times as long as every other wireless device to hookup with time.apple.com ...

Maybe I should email Mr Jobs and ask :cool:

And if there's any frackin' to frack about, maybe it's Shaw this time ... d'oh
Although the coincidence is still quite odd.

Many thanks for your assistance Cruella DaVilla :)

Cruella DaVilla, haha, never heard that one .... not :)