Hacker News new | ask | show | jobs
by latchkey 5256 days ago
This is good, but for my app, we just decided to do all of the presentation on the client side using javascript. This prevents us from having to know or store the users tz at all. That way, whatever tz they are in is the correct one. =)

We thought this might be an issue for things like emailing purchase receipts to people since that is something that can't just be 'rendered' on the client, but we ended up just asking ourselves "What would amazon do?" and looked at an emailed Amazon receipt.

You will notice that there isn't a single time in the receipt other than when the email was sent. Looked at a receipt from Apple. Same thing. Problem solved by just removing the timestamp from the receipt.

Thought that was an interesting tidbit that I hadn't thought of before.

This is the JS library I used and am pretty happy with: http://momentjs.com/

1 comments

Interesting.

I recently was evaluating JS and Python for handling time in my app. The goal was not to localize to a specific timezone for the client, but rather to inform the client of where in the world a current time is.

I ended up picking the Python backend solution because it was easier to reason about with the more abstract `datetime` primitives.