当前位置: 动力学知识库 > 问答 > 编程问答 >

ruby on rails - What is the alternative to ActiveSupport::TimeWithZone that does not use floats to store fractional part of seconds?

问题描述:

I am developing a Ruby on Rails application which logic strongly relies on timestamps. They must have an accuracy of 1 ms. I use PostgreSQL as the DB. While recent version of PostgreSQL support date/time columns with microsecond accuracy (values are internally stored as integers), it is dropped when ActiveRecord builds objects upon these data because ActiveSupport::TimeWithZone internally uses floats.

Before I will rewrite part of ActiveSupport::TimeWithZone or ActiveRecord's logic I would kindly ask if anyone knows a drop-in, well-tested solution for this problem? I was seeking for gems but I wasn't able to find anything meaningful.

分享给朋友:
您可能感兴趣的文章:
随机阅读: