Setting Time Zone in MiSTer

Kernel, Main, Utilities & Applications, Miscellaneous Devices.
User avatar
JudgeDrokk
Posts: 120
Joined: Mon May 25, 2020 9:45 am
Has thanked: 93 times
Been thanked: 21 times

Setting Time Zone in MiSTer

Unread post 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!
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: Setting Time Zone in MiSTer

Unread post by jca »

What about the timezone script?
User avatar
Captain FPGA
Top Contributor
Posts: 373
Joined: Sun Apr 11, 2021 9:19 pm
Has thanked: 195 times
Been thanked: 25 times

Re: Setting Time Zone in MiSTer

Unread post by Captain FPGA »

Dreams don't die!
Image
elvis
Posts: 63
Joined: Sun May 24, 2020 9:25 pm
Has thanked: 41 times
Been thanked: 37 times

Re: Setting Time Zone in MiSTer

Unread post 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.
User avatar
EkDor
Posts: 12
Joined: Thu Oct 07, 2021 5:38 pm

Re: Setting Time Zone in MiSTer

Unread post 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,

User avatar
EkDor
Posts: 12
Joined: Thu Oct 07, 2021 5:38 pm

Re: Setting Time Zone in MiSTer

Unread post 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

Flandango
Core Developer
Posts: 459
Joined: Wed May 26, 2021 9:35 pm
Has thanked: 59 times
Been thanked: 383 times

Re: Setting Time Zone in MiSTer

Unread post 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.

User avatar
EkDor
Posts: 12
Joined: Thu Oct 07, 2021 5:38 pm

Re: Setting Time Zone in MiSTer

Unread post 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,.

Flandango
Core Developer
Posts: 459
Joined: Wed May 26, 2021 9:35 pm
Has thanked: 59 times
Been thanked: 383 times

Re: Setting Time Zone in MiSTer

Unread post 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.

User avatar
EkDor
Posts: 12
Joined: Thu Oct 07, 2021 5:38 pm

Re: Setting Time Zone in MiSTer

Unread post 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.

Post Reply