Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How I Can config Time Zone of Time in Line Notifications Message ? #3153

Closed
2 tasks done
banpot408 opened this issue May 12, 2023 · 11 comments · Fixed by #3203
Closed
2 tasks done

How I Can config Time Zone of Time in Line Notifications Message ? #3153

banpot408 opened this issue May 12, 2023 · 11 comments · Fixed by #3203
Labels

Comments

@banpot408
Copy link

⚠️ Please verify that this bug has NOT been raised before.

  • I checked and didn't find similar issue

🛡️ Security Policy

📝 Describe your problem

How I Can config Time Zone of Time in Line Notifications Message ?
Now can't change still show only UTC Time

📝 Error Message(s) or Log

No response

🐻 Uptime-Kuma Version

Version: 1.21.3

💻 Operating System and Arch

Ubuntu 20.04 x86

🌐 Browser

Chrome

🐋 Docker Version

No response

🟩 NodeJS Version

No response

@banpot408 banpot408 added the help label May 12, 2023
@CommanderStorm
Copy link
Collaborator

What is your deployment?
How have you tried setting the timezone? (what are the steps you tried to solve this? What were the results?)

@Roomiiaan
Copy link

How can I set the time zone in notifications? Only showing UTC 😥

@CommanderStorm
Copy link
Collaborator

Please answer the question I asked, otherwise helping you is really difficult.

What is your deployment? (Docker/Nodejs/...?)
How have you tried setting the timezone? (what are the steps you tried to solve this? What were the results?)

image

@Roomiiaan
Copy link

Roomiiaan commented May 29, 2023 via email

@CommanderStorm
Copy link
Collaborator

What notification provider are you using? (where exactly are you seeing the wrong timezone? Please provide screenshots)
Can you also provide a screenshot of the settings panel?

What happens when you run with timezone+localtime mounted?

docker run -p 3001:3001 -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime louislam/uptime-kuma:latest

@banpot408
Copy link
Author

banpot408 commented May 29, 2023

Please answer the question I asked, otherwise helping you is really difficult.

What is your deployment? (Docker/Nodejs/...?)
How have you tried setting the timezone? (what are the steps you tried to solve this? What were the results?)

image

Hi CommanderStorm

What is your deployment? (Docker/Nodejs?)
- i not sure coz my old team have a install. but i think is on node-js (Non-Docker)

How have you tried setting the timezone? (what are the steps you tried to solve this? What were the results?)
- i try setting the timezone on uptime system already but not work on notify ![2023-05-29_22-55-19]still show time zone at UTC
- and i also try to setting time zone of my server to gmt+7 already but not work aslo.
- i attach results as below.
-
============================================================================

image

@banpot408 banpot408 reopened this May 29, 2023
@Roomiiaan
Copy link

/etc/timezone:/etc/timezone

I also tried to mount the time zone... Without success :(
grafik
Still showing UTC time (time zone is utc+2 Europe/Berlin)

@CommanderStorm
Copy link
Collaborator

CommanderStorm commented May 29, 2023

@banpot408 @Roomiiaan
This is something, that is hardcoded in the Notification template (example of Line):

} else if (heartbeatJSON["status"] === DOWN) {
let downMessage = {
"message": "\n[🔴 Down]\n" + "Name: " + monitorJSON["name"] + " \n" + heartbeatJSON["msg"] + "\nTime (UTC): " + heartbeatJSON["time"]
};
await axios.post(lineAPIUrl, qs.stringify(downMessage), config);
} else if (heartbeatJSON["status"] === UP) {
let upMessage = {
"message": "\n[✅ Up]\n" + "Name: " + monitorJSON["name"] + " \n" + heartbeatJSON["msg"] + "\nTime (UTC): " + heartbeatJSON["time"]
};
await axios.post(lineAPIUrl, qs.stringify(upMessage), config);
}

Opinions if this should to be changed?
I would argue that knowing when (in UTC) the post was made could be useful. The time in your local time is written at the bottom.
On the other hand I don't think this is particularly useful information except if working in an post-geografical environment.
CC: @chakflying

@Roomiiaan
Copy link

I understand what you mean @CommanderStorm I do think, however, that misunderstandings can arise. In Germany we are far away from UTC and didn't need this information at all.
Maybe you can add a button when creating notifications: "Use configured time zone from settings"

@banpot408
Copy link
Author

I understand what you mean @CommanderStorm I do think, however, that misunderstandings can arise. In Germany we are far away from UTC and didn't need this information at all. Maybe you can add a button when creating notifications: "Use configured time zone from settings"

i am agree with @Roomiiaan

@louislam
Copy link
Owner

You cannot config currently. Since the server timezone was added after most notifications, they are hardcoded UTC. They need to be updated in order to display the server timezone, like this: https://github.com/louislam/uptime-kuma/pull/3152/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants