[GH-ISSUE #927] Date/time is wrong (UTC instead of local time) #651

Closed
opened 2026-05-07 00:26:17 +02:00 by BreizhHardware · 5 comments

Originally created by @luckman212 on GitHub (Oct 21, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/927

I read https://github.com/binwiederhier/ntfy/pull/307 and https://github.com/binwiederhier/ntfy/issues/700 but even after being sure I am exporting the correct TZ variable (America/New_York in my case) and bind mounting /etc/localtime from the docker host (-v /etc/localtime:/etc/localtime:ro) I am still getting this...

From my ntfy container (2.7.0 pulled from Docker hub)

/ # date
Sat Oct 21 19:21:44 UTC 2023
/ # echo $TZ
America/New_York

From the docker host

root@nas:~# date
Sat Oct 21 03:21:46 PM EDT 2023

I think this is why my scheduled notifications aren't working (?). Is this wrong? Or is date from the container just showing the time in UTC? (MM:SS is correct)

Can anyone help?

Originally created by @luckman212 on GitHub (Oct 21, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/927 I read https://github.com/binwiederhier/ntfy/pull/307 and https://github.com/binwiederhier/ntfy/issues/700 but even after being sure I am exporting the correct `TZ` variable (`America/New_York` in my case) and bind mounting `/etc/localtime` from the docker host (`-v /etc/localtime:/etc/localtime:ro`) I am still getting this... ## From my ntfy container (2.7.0 pulled from Docker hub) ``` / # date Sat Oct 21 19:21:44 UTC 2023 / # echo $TZ America/New_York ``` ## From the docker host ``` root@nas:~# date Sat Oct 21 03:21:46 PM EDT 2023 ``` I _think_ this is why my scheduled notifications aren't working (?). Is this wrong? Or is `date` from the container just showing the time in UTC? (MM:SS is correct) Can anyone help?
Author
Owner

@luckman212 commented on GitHub (Oct 21, 2023):

Hmm, date -u from the docker host returns

root@nas:~# date -u
Sat Oct 21 19:28:21 UTC 2023

So maybe this isn't really a problem? If not, then I need to figure out why scheduled notifications aren't working...

<!-- gh-comment-id:1773902057 --> @luckman212 commented on GitHub (Oct 21, 2023): Hmm, `date -u` from the docker host returns ``` root@nas:~# date -u Sat Oct 21 19:28:21 UTC 2023 ``` So maybe this isn't really a problem? If not, then I need to figure out why scheduled notifications aren't working...
Author
Owner

@slaw54 commented on GitHub (Oct 23, 2023):

Based in New Zealand so currently time +13 GMT. Scheduling works fine if delay entered in Unix format but any time entered as numerals passes into the following day so no simple way to schedule say for 17.00 today. Using "today" makes no difference. I am sending HTTP from android.

<!-- gh-comment-id:1775750294 --> @slaw54 commented on GitHub (Oct 23, 2023): Based in New Zealand so currently time +13 GMT. Scheduling works fine if delay entered in Unix format but any time entered as numerals passes into the following day so no simple way to schedule say for 17.00 today. Using "today" makes no difference. I am sending HTTP from android.
Author
Owner

@luckman212 commented on GitHub (Oct 23, 2023):

Thinking about it, this actually makes sense. Unless a header is passed by the client indicating the client time zone, there's really no way the ntfy server could know what time zone they are in to set the schedule accordingly.

<!-- gh-comment-id:1775784246 --> @luckman212 commented on GitHub (Oct 23, 2023): Thinking about it, this actually makes sense. Unless a header is passed by the client indicating the client time zone, there's really no way the ntfy server could know what time zone they are in to set the schedule accordingly.
Author
Owner

@slaw54 commented on GitHub (Oct 23, 2023):

The workaround is to offset the time in the APP but the Eastern Standard Time HTTP example in the NTFY documentation does not fit in with this.

<!-- gh-comment-id:1775996694 --> @slaw54 commented on GitHub (Oct 23, 2023): The workaround is to offset the time in the APP but the Eastern Standard Time HTTP example in the NTFY documentation does not fit in with this.
Author
Owner

@binwiederhier commented on GitHub (Nov 17, 2023):

This is a dup of https://github.com/binwiederhier/ntfy/pull/307 and https://github.com/binwiederhier/ntfy/issues/894. It'll be fixed in the next release.

<!-- gh-comment-id:1816507615 --> @binwiederhier commented on GitHub (Nov 17, 2023): This is a dup of https://github.com/binwiederhier/ntfy/pull/307 and https://github.com/binwiederhier/ntfy/issues/894. It'll be fixed in the next release.
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/ntfy#651
No description provided.