mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 15:05:49 +03:00
[GH-ISSUE #1159] $NOW returns UTC only. Would be better to have it return local time in the container, or have a new tag that dows #798
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#798
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @marcusbabajews on GitHub (May 13, 2025).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/1159
@cuu508 commented on GitHub (May 13, 2025):
By container do you mean the container running Healthchecks? If yes, what's the deal with using non-UTC timezone in the container? Why would you do that?
@marcusbabajews commented on GitHub (May 13, 2025):
Really sorry - i wrote that way to quickly. When i use the $NOW tag it always returns a UTC time, regardless of the timezone set within the container.
For example, a telegram bot that is being provided an update from healthchecks will receive a message based on the following JSON payload i'm delivering to it:
{
"chat_id": "-XXXredactedXXX",
"text": "🚨 $NAME is down\nLast ping:
$NOW\nOpen Check","parse_mode": "MarkdownV2"
}
in telegram, the $NOW field is expanded to UTC time even when i have a timezone set for the container
@cuu508 commented on GitHub (Jun 2, 2025):
The idea with
$NOWwas to return an ISO8601 timestamp which is easy for machines to consume (and format for display in any needed timezone).In your Telegram example there's of course no machine in the middle to perform the formatting, so the user sees the raw timestamp. But even if it was in user's timezone, showing an ISO8601 timestamp to the end user is not ideal. So I'm not sure adding $NOW_LOCAL or something similar would be "worth it" here, it would still be poor user experience.
PS. Internally, Healthchecks operates in UTC, regardless of the timezone set in the host OS or container. This is by design, doing date arithmetic for cron schedules would be a nightmare otherwise.
PPS. Have you considered using the native Telegram integration?