UI post.created_at date doesn't match DB

In a user’s activity feed, the date at which a post was made is displayed:

However, when I view this post with the data explorer plugin, I see that it was created on April 21st, not April 20th.

So, in the Db the post was created on 4/21, but the UI displays it as being posted on 4/20.

Why does this matter?
We have a custom feature to track visit streaks. Occasionally, people will reach out asking why their streak broke. In this case, it broke because in the Db the user had no activity on 4/20, but from their perspective they see that they posted on that day.

Does anyone know why this would be different in the UI and Db?

2 Likes

The database timestamps are in UTC (the Z at the end stands for “Zulu time”). The UI timestamps will be in the local timezone of the browser. Could that explain the discrepancy?

7 Likes

Ah right. Yeah that’s definitely what’s going on. The post was around midnight UTC so on my browser (EST) it shows it -4 hours, putting it back to 4/20.

False alarm, sorry!

Thanks for the help @david

4 Likes