[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

Closed
opened 2026-02-25 23:43:37 +03:00 by kerem · 3 comments
Owner

Originally created by @marcusbabajews on GitHub (May 13, 2025).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/1159

Originally created by @marcusbabajews on GitHub (May 13, 2025). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/1159
kerem closed this issue 2026-02-25 23:43:37 +03:00
Author
Owner

@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?

<!-- gh-comment-id:2876151960 --> @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?
Author
Owner

@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

<!-- gh-comment-id:2877970977 --> @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`\n[Open Check]($STATUS_URL)", "parse_mode": "MarkdownV2" } in telegram, the $NOW field is expanded to UTC time even when i have a timezone set for the container
Author
Owner

@cuu508 commented on GitHub (Jun 2, 2025):

The idea with $NOW was 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?

<!-- gh-comment-id:2931626709 --> @cuu508 commented on GitHub (Jun 2, 2025): The idea with `$NOW` was 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?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#798
No description provided.