USM Dashboard Context Selector time is offset by an hour

Document ID:  TEC1697651
Last Modified Date:  07/10/2017
{{active ? 'Hide' : 'Show'}} Technical Document Details

Products

  • CA Unified Infrastructure Management

Releases

  • CA Unified Infrastructure Management:Release:8.47
  • CA Unified Infrastructure Management:Release:8.5
  • CA Unified Infrastructure Management:Release:8.51
  • CA Unified Infrastructure Management:Release:8.4
  • CA Unified Infrastructure Management:Release:8.41
  • CA Unified Infrastructure Management:Release:8.42

Components

  • UIM - UMP:UIMUMP
Introduction:

This a clarification about the use of the context selector widget in the UMP dashboard designer portlet.

Background:

The context selector is used to set a time range for an associated widget to interactively filter by a preset list of time range (Last hour, Last 4 hours, etc). In a recent use case we saw that the "last hour" setting on the context selector showed data being one hour off depending on the local time setting.

Environment:
Any UMP version
Instructions:

When the user has a context selector on a dashboard, they are choosing to do substitution in the SQL query using ${startTime} and ${endTime} parameters in the queries they write. When that gets executed on the backend, we get the epoch time in milliseconds to substitute in the query.

When that gets added into the query, you see something like the following: created > dateadd (SECOND, 1498515655296/1000, '1970-1-1')

The problem is that the “created” date is aware of daylight savings, but the date created from the dateadd method is not. The result of the dateadd will give a datetime in UTC. When we compare against the “created” date, it is offset by an hour because of daylight savings.

That is why we are getting data an hour old because the millis are creating a date that is UTC, which is an hour ago because this system is in daylight savings. 

If you are using SQL Server 2016, you could look at using “at time zone” to select the “created” column as a UTC date. Otherwise, you could try something like this: Dateadd(hour, DATEDIFF(HH, GETUTCDATE(), GETDATE()), dateadd (SECOND, 1498515655296/1000, '1970-1-1'))

Additional Information:

For more details on how to use a context selector please review this tech doc:

https://support.ca.com/us/knowledge-base-articles.tec1021157.html

 

Please help us improve!

Will this information enable you to resolve your issue?

Please tell us what we can do better.

{{feedbackText.length ? feedbackText.length : '0'}}/255

{{status}}

Not what you were looking for?

Search Again >

Product Information

Support by Product >

Communities

Join a Community >