Page 1 of 1

Setting Time Zone in MiSTer

Posted: Wed Sep 30, 2020 8:06 pm
by JudgeDrokk
I have a 2nd MiSTer that, unlike my first, doesent have an RTC but instead grabs the time from the 'net but it's always one hour out.

What's the simplest way to change the timezone on MiSTer so it displays the time where I am (UK).

Thanks!

Re: Setting Time Zone in MiSTer

Posted: Tue Mar 09, 2021 3:04 pm
by jca
What about the timezone script?

Re: Setting Time Zone in MiSTer

Posted: Tue Jun 01, 2021 11:24 am
by Captain FPGA

Re: Setting Time Zone in MiSTer

Posted: Tue Jun 01, 2021 11:50 am
by elvis
JudgeDrokk wrote: Wed Sep 30, 2020 8:06 pm I have a 2nd MiSTer that, unlike my first, doesent have an RTC but instead grabs the time from the 'net but it's always one hour out.

What's the simplest way to change the timezone on MiSTer so it displays the time where I am (UK).

Thanks!
MiSTer will obey DHCP supplies timezones if your DHCP server can supply them.

DHCP options 100 and 101 are the ones you need to modify. Generally speaking setting your DHCP server (for most people at home, their Internet router) to the correct time zone will do it.

Re: Setting Time Zone in MiSTer

Posted: Sat Jan 13, 2024 2:52 pm
by EkDor
jca wrote: Tue Mar 09, 2021 3:04 pm

What about the timezone script?

I have this issue as well. I'm using StarLink and thought my time would be correct. But for me it is set to another state in Australia. When I run the timezone script is loads shows what it's set to and then end returning back to the MiSTer menu. The file "timezone" in the Linux directory, which is being referenced in the TimeZone script, is unreadable.

Is there a ssh/terminal method? I looked up linux information for this but file location doesn't match.

Thanks,


Re: Setting Time Zone in MiSTer

Posted: Sun Jan 14, 2024 5:39 am
by EkDor
EkDor wrote: Sat Jan 13, 2024 2:52 pm

The file "timezone" in the Linux directory, which is being referenced in the TimeZone script, is unreadable.

I decided to play around with this file when I realized I recognized some of the code as timezone information and searched it and tried replacing it with that of my timezone. I preserved the hidden code. Changing it seems to have no effect on the date and/or time.

So I guess when the MiSTer boots the LinuxOS looks up the timezone and then adds it to that file "/media/fat/linux/timezone" and the MiSTer core is getting it form there? Maybe not. If I delete it and then run timezone script it recreated the file. I tried putting a blank file there and changed the privileges; but the MiSTer overwrote regardless.

Assuming that, as mentioned earlier in this thread, it's getting it from my router each boot; which for some reason is set to a different state. Being Startlink I am unable to figure out how to fix this without contacting them. Can't find any option or reference to the routers timezone. I would be ok to remove it; would rather it not there than incorrect. Actually would prefer it not to be there anyway as an option.

Cheers


Re: Setting Time Zone in MiSTer

Posted: Sun Jan 14, 2024 2:15 pm
by Flandango
EkDor wrote: Sun Jan 14, 2024 5:39 am
EkDor wrote: Sat Jan 13, 2024 2:52 pm

The file "timezone" in the Linux directory, which is being referenced in the TimeZone script, is unreadable.

I decided to play around with this file when I realized I recognized some of the code as timezone information and searched it and tried replacing it with that of my timezone. I preserved the hidden code. Changing it seems to have no effect on the date and/or time.

So I guess when the MiSTer boots the LinuxOS looks up the timezone and then adds it to that file "/media/fat/linux/timezone" and the MiSTer core is getting it form there? Maybe not. If I delete it and then run timezone script it recreated the file. I tried putting a blank file there and changed the privileges; but the MiSTer overwrote regardless.

Assuming that, as mentioned earlier in this thread, it's getting it from my router each boot; which for some reason is set to a different state. Being Startlink I am unable to figure out how to fix this without contacting them. Can't find any option or reference to the routers timezone. I would be ok to remove it; would rather it not there than incorrect. Actually would prefer it not to be there anyway as an option.

Cheers

Try this:
Look for your particular country/state/timezone in /usr/share/zoneinfo, and for example, if you live in Melbourne, Australia, then go to /usr/share/zoneinfo/Australia, and copy the Melbourne file to /media/fat/linux/timezone. Reboot and see if that helps.


Re: Setting Time Zone in MiSTer

Posted: Thu Jan 18, 2024 6:46 am
by EkDor
Flandango wrote: Sun Jan 14, 2024 2:15 pm

Try this:
Look for your particular country/state/timezone in /usr/share/zoneinfo, and for example, if you live in Melbourne, Australia, then go to /usr/share/zoneinfo/Australia, and copy the Melbourne file to /media/fat/linux/timezone. Reboot and see if that helps.

That worked! Did a full power cycle to check it and it's all good. Thank you so much!

Ok I had previously copied part of the code, as mentioned earlier, which didn't work. But this time I just copied the entire file over and renamed it to "timezone" and it worked. There must have been more code hidden in the unreadable code that caused issue resulting in the OS replacing it with a newly generated one; which was of course was wrong for me.

Cheers,.


Re: Setting Time Zone in MiSTer

Posted: Thu Jan 18, 2024 11:57 am
by Flandango
EkDor wrote: Thu Jan 18, 2024 6:46 am

Ok I had previously copied part of the code, as mentioned earlier, which didn't work. But this time I just copied the entire file over and renamed it to "timezone" and it worked. There must have been more code hidden in the unreadable code that caused issue resulting in the OS replacing it with a newly generated one; which was of course was wrong for me.

If you use the Timezone script from the Scripts folder, it determines your location based on your external IP address and what your service provider has registered as its geolocation. In most cases it's fairly accurate, but in other cases, perhaps like with Starlink, they are more general to a single point in a country or state....which may not be yours.


Re: Setting Time Zone in MiSTer

Posted: Sun Jan 21, 2024 6:44 am
by EkDor
Flandango wrote: Thu Jan 18, 2024 11:57 am

If you use the Timezone script from the Scripts folder, it determines your location based on your external IP address and what your service provider has registered as its geolocation. In most cases it's fairly accurate, but in other cases, perhaps like with Starlink, they are more general to a single point in a country or state....which may not be yours.

Yep thanks. It turns out that's what is going on as I realized another service in my life seems to think I am in that same "wrong" location.
Thanks.