A user, barryvan, noticed that the anniversaries page on their forum is showing dates one day in the past. They suspect this might be due to their time zone (GMT+8) differing from the server’s time zone. Others agree that this is an issue, particularly for localized communities.
jomaxro points out that Discourse already localizes times elsewhere in the UI, so this inconsistency feels like a bug. pfaffman wonders if fixing this issue would require accounting for 24+ different time zones.
A possible solution is to display anniversaries based on the user’s local time zone, as suggested by sam. techAPJ mentions that a fix has been implemented to consider time zone offsets.
However, techAPJ later notes that some edge cases remain, particularly for users who created their accounts between 23:30 and 00:00. These issues have been addressed through subsequent commits.
The discussion highlights the need for a more nuanced approach to handling time zones in Discourse, especially for localized communities.
That’s one way to look at it I guess. But I’m assuming the users are queried on page load, so there’s really only “one” set at a time.
Here’s a better example. The post you just made shows up for me as “June 8, 2017 12:45 AM”. If I was to fly across the country to California, I’d expect that post to show as “June 7, 2017 9:45 PM”.
…and I just earned the “anniversary” badge this morning. This does feel like a bug to me.
Could it be mitigated by simply changing the timezone of the server to something more applicable for my community? We’re (mainly) in Australia, so processing everything as, say, GMT+8 or GMT+10 would make this all feel less odd.
Since the server doesn’t know a user’s time zone, maybe the easiest fix for this would be to award the badge one day later? For some, that will mean they get it late, but that will probably not be experienced as a bug as much as an early award is.
Another option might be to simply specify in the UI that these times are based on the server’s time zone.
강하게 지역화된 커뮤니티의 맥락에서는 discourse의 케이크데이(cakeday)에 사용할 시간대를 지정할 수 있어야 한다고 생각합니다. 서버의 시간대를 변경하는 것은 우리가 실제로 할 수 있는 일이 아닙니다.
이것은 복잡한 문제이며, 사용자가 "시간대"를 지정할 수 있게 된 지금도 어떻게 해결해야 할지 확실하지 않습니다.
호주의 포럼에 2019년 1월 2일 오전 8시에 가입했다고 가정해 보겠습니다.
“케이크데이” 기준 1주년은 2010년 1월 1일이 됩니다.
1월 2일 오전 8시에 기념일 페이지를 방문하면 2일이 아닌 2010년 1월 1일의 기념일이 표시됩니다.
여기서 우리가 묻고 있는 것은 사용자의 프로필에 정의된 “로컬” 시간대를 기준으로 이러한 사항을 계산하는 것입니다.
즉:
사용자 프로필의 로컬 시간대가 호주이므로, 1주년은 2019년 1월 1일이어야 합니다.
2일에 기념일 페이지를 방문하면 2일이 표시되어야 합니다.
현재로서는 저는 단순한 수정을 지지합니다. 즉, 기념일 페이지를 렌더링할 때 현재 로그인한 사용자의 로컬 시간대를 확인하고, UTC 현재 날짜 대신 해당 날짜를 사용하는 것입니다. 로그인된 사용자의 경우를 위한 조치로, 이는 꽤 쉬운 변경이며 아마도 2줄의 코드만 수정하면 될 것입니다.
I believe @tgxworld already fixed this to consider timezone offset via:
and
EDIT: I am in timezone UTC+5:30 but have an offset of 6 hours, so I am seeing few edge cases for users who created account between 23:30 and 00:00. Looking into it.