Add Time Zone to notification emails

I get emails telling me things like “The device will be restarted automatically on Friday, October 6 at 03:30 AM.” and I don’t know what time zone is being used here. I can make assumptions but think it would be good for all users to include the time zone the restart will happen. I did a quick search and did not see this anywhere else.

Will have deeper look for source code so I can submit a patch but capturing here so the idea is not lost.

2 Likes

Found the string at src/scripts/notifier · master · Turris / User notifications · GitLab and will work on a patch

While I figure out how to use the gitlab here is a diff for Turris / User notifications · GitLab

$ git diff
diff --git a/src/scripts/notifier b/src/scripts/notifier
index b35688b..15a7405 100755
--- a/src/scripts/notifier
+++ b/src/scripts/notifier
@@ -162,7 +162,7 @@ schedule_restart() {
        if [ "$lang" = "cs" ]; then
                echo -e "Zařízení bude automaticky restartováno dne $($date_cmd '+%d. %m. %Y v %H:%M' -d "$wanted_time").\n" >> "$1"
        else
-               echo -e "The device will be restarted automatically on $($date_cmd '+%A, %B %e at %I:%M %p' -d "$wanted_time").\n" >> "$1"
+               echo -e "The device will be restarted automatically on $($date_cmd '+%A, %B %e at %I:%M %p %Z' -d "$wanted_time").\n" >> "$1"
        fi
 }
1 Like

I need to understand the process for code submits. I can’t fork on my new account which I understand could be a thing on new accounts. So I made an issue at Add timezone to emails (#11) · Issues · Turris / User notifications · GitLab

Hi,

Thanks for submitting diff, what helps you! @mmtj will look at it. :slight_smile:

Unfortunately, it is complicated to use our CZ.NIC GitLab for newcomers to submit pull requests, but if you let us know that you want to fork our repositories and send a pull request, we will ask them to allow it for you. But all of our repositories are mirrored to GitHub when it is much easier to propose any changes.

This behavior prevents our CZ.NIC GitLab’s administrators prevent being overloaded by spam(bots).

Thanks for the info, do you want me to do a pull request for adding %Z or can add it? If I do a PR I would end up adding a README and other needed things.

1 Like

You can pull from my git server aka Turris emails with timezone with timestamp · 05dcc41a75 - turris-user-notify - Lathama Git Server

2 Likes

Awesome, I see it is commited!

Hi,

Thanks for the patch!

With patch provided, it was quite easy to include it into Turris OS :slight_smile:

1 Like

And it is working! Just got an email!

The device will be restarted automatically on Thursday, August 11 at 03:30 AM UTC.

1 Like