问题
By default, DataMapper creates DateTime properties of type timestamp without time zone
in PostgreSQL. I'd like to change that default for my project to timestamp with time zone
. How can this be done?
回答1:
Just set ENV['TZ'] = 'your timezone'
回答2:
just in case some jruby users pass by:
you need to set ENV['TZ'] = 'your timezone' and
org.joda.time.DateTimeZone.setDefault(org.joda.time.DateTimeZone.forID('your timezone'))
'UTC' works fine for me. for other timezone you might need to dig into joda-time.
来源:https://stackoverflow.com/questions/5876563/how-do-i-tell-datamapper-to-use-timestamp-with-time-zone-for-datetime-properti