From 402e4e769dbdfb6422499f22679fd0431747f3fa Mon Sep 17 00:00:00 2001 From: prathabanKavin Date: Tue, 23 May 2023 22:44:08 +0530 Subject: [PATCH] Fix operation log timing incorrectness --- .../mgt/dao/impl/operation/SQLServerOperationDAOImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java index 6de5008fc8..c9e957987d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java @@ -194,12 +194,12 @@ public class SQLServerOperationDAOImpl extends GenericOperationDAOImpl { operation = new Operation(); operation.setId(rs.getInt("ID")); operation.setType(Operation.Type.valueOf(rs.getString("TYPE"))); - operation.setCreatedTimeStamp(new Timestamp(rs.getLong("CREATED_TIMESTAMP") * 1000L).toString()); + operation.setCreatedTimeStamp(new Timestamp(rs.getLong("CREATED_TIMESTAMP") * 1000L).toInstant().toString()); if (rs.getLong("UPDATED_TIMESTAMP") == 0) { operation.setReceivedTimeStamp(""); } else { operation.setReceivedTimeStamp( - new java.sql.Timestamp((rs.getLong("UPDATED_TIMESTAMP") * 1000)).toString()); + new java.sql.Timestamp((rs.getLong("UPDATED_TIMESTAMP") * 1000)).toInstant().toString()); } operation.setCode(rs.getString("OPERATION_CODE")); operation.setStatus(Operation.Status.valueOf(rs.getString("STATUS")));