Attention on time zone while using today.to_time in your Rails application!
Ruby to_time in your Rails application
Suppose, you need to convert some date to datetime. You can use the Ruby to_time method:
1 2 3 4 5 6 7
If your server time zone is UTC, but Rails application has different time zone, for example:
converting from date to time will ignore Rails settings!
It happens, when you need to output your date in epoch format (for example: in json).
I suggest to convert your date to utc and than to epoch.