diff --git a/lib/liudesk_cmdb/model.rb b/lib/liudesk_cmdb/model.rb index f901bdce1a6274ebc40b8f15f3466440a3cd4472..972822d614f2cd10e9b05b9309b4ab41a518a808 100644 --- a/lib/liudesk_cmdb/model.rb +++ b/lib/liudesk_cmdb/model.rb @@ -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