projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
18183: Merge branch 'main' into 18183-revoke-tokens-when-user-is-disabled
[arvados.git]
/
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 80516521b4524f79950522325c945b22220d3538..5e1634ecb96f17661002afc3eb62dea44100adad 100644
(file)
--- a/
services/api/lib/db_current_time.rb
+++ b/
services/api/lib/db_current_time.rb
@@
-3,13
+3,13
@@
# SPDX-License-Identifier: AGPL-3.0
module DbCurrentTime
# SPDX-License-Identifier: AGPL-3.0
module DbCurrentTime
- CURRENT_TIME_SQL = "SELECT clock_timestamp()"
+ CURRENT_TIME_SQL = "SELECT clock_timestamp()
AT TIME ZONE 'UTC'
"
def db_current_time
def db_current_time
- Time.parse(ActiveRecord::Base.connection.select_value(CURRENT_TIME_SQL)
).to_time
+ Time.parse(ActiveRecord::Base.connection.select_value(CURRENT_TIME_SQL)
+ " +0000")
end
def db_transaction_time
end
def db_transaction_time
- Time.parse(ActiveRecord::Base.connection.select_value(
'SELECT current_timestamp')).to_time
+ Time.parse(ActiveRecord::Base.connection.select_value(
"SELECT current_timestamp AT TIME ZONE 'UTC'") + " +0000")
end
end
end
end