This project is archived and is in readonly mode.
Time saved as UTC but read as localtime
-
joserwan
ugly formatting !
Exemple :
d = MyObject.last => # >> d.created_at => Tue, 16 Mar 2010 15:56:53 UTC +00:00 >> d.created_at = Time.now => Thu Mar 18 15:01:22 -0400 2010 >> d.save => true >> d.created_at => Thu, 18 Mar 2010 19:01:22 UTC +00:00 >> timestamp = d.created_at.localtime.to_i => 1268938882 >> Peer.find_by_created_at(timestamp) Peer Load (0.9ms) SELECT * FROM `my_objects` WHERE (`my_objects`.`created_at` = '2010-03-18 15:01:22') LIMIT 1 => nil
-
José Valim
- State changed from new to wontfix
It's always saved in the database as UTC. You can configure the format on READ by changing config/environment.rb.