question

lalluyn avatar image
lalluyn asked

How to change timezone in ssh console ?

Hello,


Timezone is defined in Cerbo interface but when I want to schedule charging on grid, only UTC time is considered. How to modify clock to be on my timezone (Pacific Noumea)


Thank you for your help



MPPT Controllers
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

3 Answers
jeroen avatar image
jeroen answered ·

You can do the following to get the date without modifying the rootfs, so it will continue to work after a firmware update.

root@ccgx:~# TZ=Pacific/Noumea date
Sat Jul 31 18:53:47 +11 2021
root@ccgx:~# date
Sat Jul 31 07:53:48 UTC 2021

Or you can use:

export TZ=Pacific/Noumea

, which will make it the default for this ssh login. You can add that to .profile in the home directory, so it will be set by default for every ssh login. (and that will survive a firmware update)

3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Kevin Windrem avatar image Kevin Windrem commented ·
Excellent info.

Dealing with log timestamps in UTC has been a frustration for me and it wasn't clear if changing the root user's timezone would upset other parts of the system.

This should be added to the root access instructions.
0 Likes 0 ·
jeroen avatar image jeroen ♦ Kevin Windrem commented ·
Why? This is just standard unix behaviour, it is not even linux specific and has nothing to do venus at all. This is decades old...
0 Likes 0 ·
Kevin Windrem avatar image Kevin Windrem jeroen ♦ commented ·
The "why" is because the times used in Venus OS use their own time zone. It was not at all clear how changing the unix time zone would interact with "Venus time". I did not change the unix time zone because I was afraid the unix time zone offset would be added to the one set up in the Venus Time & Date menu.


Adding a note in the root access would assure everyone it's OK to change the unix time zone.

In addition, I can't say I knew how to make the unix timezone change.

0 Likes 0 ·
wkirby avatar image
wkirby answered ·

Remove the symlink to the localtime file:
rm -rf /etc/localtime

Then make a new symlink to the timezone file that you want:
ln -s /usr/share/zoneinfo/Pacific/Noumea /etc/localtime

Use date to verify that your timezone is correct, it'll probably say "+11"
date


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

lalluyn avatar image
lalluyn answered ·

Thanks for your reply.


However, even with timezone defined, impossible to set "Scheduled charging" with local time. I have to specify UTC time.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.