hstore-attributes icon indicating copy to clipboard operation
hstore-attributes copied to clipboard

support ActiveSupport::TimeWithZone and store datetime in UTC

Open chifung7 opened this issue 11 years ago • 0 comments

If time zone is present, datetime attributes will be stored with timz zone e.g."2013-10-15 13:26:23 +0800". However, when they are read from database, it's converted to Time object in UTC time zone ignoring the time zone +0800.

Datetime attributes should be stored in UTC format using #utc method when they are written to database. When read from database, they should be converted to correct time zone using in_time_zone(Time.zone)

chifung7 avatar Oct 15 '13 07:10 chifung7