This question has a little religious feeling for him, but I'm going to answer it based on my personal experience.
Always store dates in unambiguous form. Storing dates in UTC is pretty much the standard in this regard.
Benefits:
- You can do simple math by date-time in the database without the need to convert them.
- You can customize the presentation of dates at the presentation level.
- Web applications can use a bit of javascript to display local time
Disadvantages:
- You need to convert all the time to some kind of "local" time on the display
- Local time ↔ UTC conversions incur a small processing fee.
Can you get the rails to do something else? Perhaps, but I never tried, since it was too much work to fight with the fact that IMHO was a reasonable design.
Does it make sense to use UTC in terms of "just use my time zone"? Yes. Your server may be located in California, your users in New York, and who decides what the local time is in this case. Server? Users? Mike, who just ended up on a business trip in London for a week? In this case, what time zone are you using?
source share