开发者

How do I tell DataMapper to use "timestamp with time zone" for DateTime properties?

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?


Just set ENV['TZ'] = 'your timezone'


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜