如何告诉DataMapper对DateTime属性使用“timestamp with time zone”?
默认情况下,DataMapper在PostgreSQL中创建timestamp without time zone
类型的DateTime属性。 我想将我的项目的默认值更改timestamp with time zone
。 如何才能做到这一点?
只需设置ENV [‘TZ’] =’你的时区’
以防一些jruby用户经过:
你需要设置ENV [‘TZ’] =’你的时区’和
org.joda.time.DateTimeZone.setDefault(org.joda.time.DateTimeZone.forID('your timezone'))
‘UTC’对我来说很好。 对于其他时区,您可能需要深入了解joda-time。