JetThoughts

Different timestamp for Rails and Postgres

September 16th 2010

Today I found a discrepancy in Rails timestamp and Postgres timestamp for my specs:

1 puts Time.now.to_i
2 puts ActiveRecord::Base.connection.execute("SELECT LOCALTIMESTAMP as c1")[0]["c1"].to_time(:local).to_i

But for console timestamps are the same. Why it is not working for specs, I dont know.

blog comments powered by Disqus

Powered by Rackspace Cloud Computing