PINE64
How do I save my time settings? - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=111)
+--- Forum: Linux on Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=114)
+--- Thread: How do I save my time settings? (/showthread.php?tid=8688)



How do I save my time settings? - MrDitchy - 01-04-2020

I would like to say a big thanks to all involved with the Pinebook Pro and MrFixit for a fantastic product.


I live in New Zealand and I can't save my time setting. I have gone from the desk top calendar to the edit button and set my city and the time. However later after a shutdown, when I turn my Pro on, I find that the time has gone back to GMT rather than the GMT+13. I have tried altering the time from both Rock and Root profiles. I then had a look at the debian help and when I tried the command "dpkg-reconfigure tzdata" in terminal I got the command not found message. Uncle Google wasn't forthcoming either,so here I am.
I am a newbee so I will need step by step instruction. My only other linux experience is with a Raspberry Pi and I tend to stick with desk top although I am starting to understand the terminal.

Thanks for any help in advance


RE: How do I save my time settings? - martinayotte - 01-04-2020

You can change symbolic link /etc/localtime to point to proper timezone.


RE: How do I save my time settings? - MrDitchy - 01-04-2020

(01-04-2020, 09:04 AM)martinayotte Wrote: You can change symbolic link /etc/localtime to point to proper timezone.

Hi Thanks for that. 
I can find my way to /etc/localtime in both the terminal and on the desk top, but have no idea how to change the symbolic link.


RE: How do I save my time settings? - martinayotte - 01-05-2020

(01-04-2020, 02:06 PM)MrDitchy Wrote: but have no idea how to change the symbolic link.
You have to first delete it with "rm /etc/localtime" and then recreate new one with "ln -s <path_to_proper_timezone> /etc/localtime".


RE: How do I save my time settings? - MrDitchy - 01-05-2020

(01-05-2020, 08:16 AM)martinayotte Wrote:
(01-04-2020, 02:06 PM)MrDitchy Wrote: but have no idea how to change the symbolic link.
You have to first delete it with "rm /etc/localtime" and then recreate new one with "ln -s <path_to_proper_timezone> /etc/localtime".

Thanks for that. As I am unsure of what the path to proper timezone is how do I find? out or is it a case of remove the /etc/localtime and just type as shown and do I do that in the /etc folder? Sorry for the repeated questions just I am very new to this.


RE: How do I save my time settings? - martinayotte - 01-06-2020

(01-05-2020, 01:06 PM)MrDitchy Wrote: As I am unsure of what the path to proper timezone is how do I find?
You can list all timezones available with "ls -lR /usr/share/zoneinfo", it will show many cities/contries/provinces/states as well as standard GMT+x.
You can then choose the one that fit you needs/wishes ...

In my case, I'm always use /usr/share/zoneinfo/America/Montreal .


RE: How do I save my time settings? - MrDitchy - 01-12-2020

(01-06-2020, 08:41 AM)martinayotte Wrote:
(01-05-2020, 01:06 PM)MrDitchy Wrote: As I am unsure of what the path to proper timezone is how do I find?
You can list all timezones available with "ls -lR /usr/share/zoneinfo", it will show many cities/contries/provinces/states as well as standard GMT+x.
You can then choose the one that fit you needs/wishes ...

In my case, I'm always use /usr/share/zoneinfo/America/Montreal .

Thanks again. I tried "ls -lR /usr/share/zoneinfo" from root and got an invalid option but I think that was a typo involving a missing space between the "-lR" and the "/", so I explored the files and found my timezone . It is /usr/share/zoneinfo/Pacific/Auckland. So if I understand correctly from / I type "rm etc/localtime" then "In -s </usr/share/zoneinfo/Pacific/Auckland> /etc/localtime" 
Thanks for taking the timeout to help me, I don't want to break my OS over the timezone. I did notice that when the Pinebook Pro was restarted after a couple of days initially the time was correct and after a couple of minutes it reset it's self to GMT.
Thanks again


RE: How do I save my time settings? - NigelT - 01-12-2020

I use these 2 commands, the first command will show the timezone and some other related info, the second command is an interactive way to change it (select your city from a list).



Code:
timedatectl

dpkg-reconfigure tzdata



RE: How do I save my time settings? - NigelT - 01-12-2020

MrDitchy, if bash tells you "command not found" when you try and run dpkg-reconfigure, it's probably because you are trying to run it as a non-root user.

When you enter a command without specifying where it is, the shell looks in the directories specified in the PATH variable to find it.

You'll notice the root account has directories in it's PATH that are not typically present in a non-root account, and the dpkg-reconfigure command is in one of those directories, hence bash doesn't find it and says "command not found".

In your case simply use sudo (it will Switch User to root before DOing the command, invoke the command, then switch back after the command has run).


Code:
$ sudo dpkg-reconfigure tzdata



RE: How do I save my time settings? - MrDitchy - 01-17-2020

(01-12-2020, 02:39 AM)NigelT Wrote: MrDitchy, if bash tells you "command not found" when you try and run dpkg-reconfigure, it's probably because you are trying to run it as a non-root user.

When you enter a command without specifying where it is, the shell looks in the directories specified in the PATH variable to find it.

You'll notice the root account has directories in it's PATH that are not typically present in a non-root account, and the dpkg-reconfigure command is in one of those directories, hence bash doesn't find it and says "command not found".

In your case simply use sudo (it will Switch User to root before DOing the command, invoke the command, then switch back after the command has run).


Code:
$ sudo dpkg-reconfigure tzdata

Thanks for that. It has worked.

I would like to thank both of you for taking the time out to help me. I have been a little late with responding, because for some reason my email decided to hide the posts in my spam folder and then not notify me. Thanks again