X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/50e9e5553d2cc194698633753c302789ae5bb2fc..3d878236c48e4856b5f58fdc2e6d35f8193e6150:/services/api/lib/db_current_time.rb diff --git a/services/api/lib/db_current_time.rb b/services/api/lib/db_current_time.rb index 120d5a406a..fdb6641521 100644 --- a/services/api/lib/db_current_time.rb +++ b/services/api/lib/db_current_time.rb @@ -1,7 +1,11 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + 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