cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Manipulate datetime in Alert Template

Mario.Morelli
Architect

Hi there

 

Does anyone have a way to manipulate the time in an alert template. It'showing the event time in UTC time, not in the customer's time

 

We have SaaS Controllers which are in Europe however the customer is in a different timezone, however from AppD Support it seems we cannot update the time in the Alert.

 

This obviously causes confusion when the customer sees the event time is out by a couple of hours 

 

Surely there is a way to add/subtract hours in the template itself?

 

Any help is appreciated:)



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A
1 REPLY 1

Mario.Morelli
Architect

For anybody else looking for this, please find working code below, we are GMT+2

You can change the code to fit your needs

 

#set ($date = ${latestEvent.eventTime})
#set ($newDate = ${date.getHours()}+(2))
$date.setHours(${newDate})
#set( $String = ' ' ) $String.format('%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tSZ', ${date})



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A
June 26 Webinar
Discover new Splunk integrations and AI innovations for Cisco AppDynamics.


Register Now!

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here