5383: Add back Time.parse(). Without it the value returned would be of the format...
[arvados.git] / services / api / lib / db_current_time.rb
index 120d5a406af41f9a50b10a0e0b7ff576a0bd0499..b4a642354626f461e99699fb1203e224bd5122c2 100644 (file)
@@ -1,7 +1,7 @@
 module DbCurrentTime
-  CURRENT_TIME_SQL = "SELECT CURRENT_TIMESTAMP"
+  CURRENT_TIME_SQL = "SELECT clock_timestamp()"
 
   def db_current_time
-    ActiveRecord::Base.connection.select_value(CURRENT_TIME_SQL).to_time
+    Time.parse(ActiveRecord::Base.connection.select_value(CURRENT_TIME_SQL)).to_time
   end
 end