dst snippets

Checklist

What you need to know to handle date and time correctly in Ruby and Rails is, at least:
* the input's time zone when parsing time and date.
* the user's time zone when calculating time and date in his/her time zone.
* Ruby and Rails date and time handling. Use Time.current and Time.zone (Rails) to avoid using the computer's time zone (Ruby).

Things to remember

* Is the given time in the user's time zone (Time.zone.local) or in UTC (Time.zone.utc)?
* The correct time zone is needed when you're accessing date components like e.g. year, month, day, hour, start of day, start of month, etc
* Rails takes care of time and date handling inside the application. It's when you accept input or want to output data that you need to tread carefully.
* Cache carefully. Maybe you need to display date and time using JavaScripts.
* Daylight savings, plus some countries or states don't even have DST, but might have had 100 years ago...
* The difference between e.g. Time.now and Time.current.
* Possible timezones: application, user, server, and database timezone
* APIs should output ISO-8601