3 ms·
Yep, my theory is that often that's done as a way to sidestep difficult issues around dealing with time zones. "2 hours ago" doesn't require you to think about
by thraxil 3y ago
Yep, my theory is that often that's done as a way to sidestep difficult issues around dealing with time zones. "2 hours ago" doesn't require you to think about whether your user is in the same time zone as your database.
- gbalduzzi 3y agoYou still have to calculate the distance between a date on the DB and a date on the client, the timezone difficult issues are not sidestepped at all
- thraxil 3y agoYour server and DB are both UTC. If not, that's something you just need to fix. The server can then calculate the difference trivially. Then you no longer need to do anything on the client. Eg, this is what Django's timesince or timeuntil filters do: https://docs.djangoproject.com/en/4.2/ref/templates/builtins/#std-templatefilter-timesince https://docs.djangoproject.com/en/4.2/ref/templates/builtins...
- deleted 3y ago[deleted]