Skip to content
Snippets Groups Projects
Verified Commit 7bf8c230 authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Round Times to avoid floating point inaccuracies

parent 7fb9eb9e
No related branches found
No related tags found
No related merge requests found
......@@ -249,7 +249,7 @@ module LiudeskCMDB
case attributes[:convert].to_s
when Time.to_s
data[key] = data[key].utc.strftime("%FT%T.%LZ") if data[key].is_a? Time
data[key] = data[key].utc.round.strftime("%FT%T.%LZ") if data[key].is_a? Time
when Symbol.to_s
data[key] = data[key].to_s if data[key].is_a? Symbol
end
......@@ -274,7 +274,7 @@ module LiudeskCMDB
case attributes[:convert].to_s
when Time.to_s
@data[key] = Time.parse(@data[key])
@data[key] = Time.parse(@data[key]).round
when Symbol.to_s
@data[key] = @data[key].to_sym
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment