db-sql
db-sql copied to clipboard
Use consistent datetime
The application uses different methods to get the current date and time. Some of them ignore the timezone, some of them not. The application should be consistent in the use of date and timestamps.
| Method | Result |
|---|---|
| Time.zone.now | Time in timezone set by config.time_zone, UTC otherwise |
| DateTime.now | Date & Time in system timezone; ignores config.time_zone |
If users deploy the application and set the application time zone (config.time_zone), the expiry dates might be wrong.