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 ·
Show more comments
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.