Based on a Rails 8 setup with Google Calendar and Geocoder gems, here are essential best practices for handling time in a scheduling application.
- Database: Always keep
config.active_record.default_timezone = :utc(this is the default). Never store local times in the database. - Why: It makes daylight saving time (DST) calculations and cross-timezone scheduling manageable. If you store "9:00 AM" without a zone, it’s ambiguous.
In config/application.rb, set a sensible default for the application logic, even if the DB is UTC.