-
Suggestion
-
Resolution: Unresolved
-
None
-
0
-
1
-
Issue Summary
In the Insight Date attribute, it is displayed in UTC time. Even though it's a Date attribute, the time value is also saved in the database with time-shift according to the user and system timezone. When we select a date for an Insight object via the GUI, the value saved in the database is automatically adjusted.
When the user is trying to update a date attribute via script as 2022-05-01 it is saved in the database as "2022-05-01 00:00:00.0" which is 2022-04-30 in UTC. So insight GUI displays it as 2022-04-30
Steps to Reproduce
- Step 1: Script used without timezone setting for updating the date on insight object:
def dateFormat = new SimpleDateFormat("dd.MM.yyyy") def date = dateFormat.parse("01.05.2022") InsightUtil.setAttributeValueOnObject(3968065, 13975, date) // setAttributeValueOnObject(objectId, attributeId, attributeNewValue)
- Step 2 : Insight GUI will display this as '2022-04-30'
Expected Results
Insight GUI should display this as of '2022-05-01'
Actual Results
Insight GUI will display this as of '2022-04-30'
Workaround
We must provide a timezone setting in the script.
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"))
- links to