datamapper / do

DataObjects
147 stars 74 forks source link

do_postgres appears to be truncating timestamp smaller than seconds #78

Open tpitale opened 9 years ago

tpitale commented 9 years ago

https://gist.github.com/tpitale/39e97ef1ca24e968dd35

The transaction_time is a column in PostgreSQL. In that example, I get back the value casted by do_postgres as a DateTime, and missing milliseconds. If I cast in PostgreSQL as a text value, and then simply call to_datetime in Ruby, the milliseconds are still present.

Any idea why this is happening and how to fix it? Thanks!

tpitale commented 9 years ago

It looks like data_objects_parse_date_time in the C is parsing and truncating at seconds.