cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The AppDynamics Community is Migrating this Friday, February 28th.


At 6pm PST, the AppDynamics Community will go into read-only mode and after migration is complete, you will be redirected to community.splunk.com.
Read more here


Anonymous
Not applicable

Question

I want to report the event time in an email template using the international standard time format. How can I do this?

 

Answer

Use the following Apache Velocity template to convert the time into the format you need.

 

If using html body:

#set( $String = '' )
$String.format('%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS%Tp ', 
$latestEvent.eventTime)

  

If using text body:

#set( $String = '' )## 
$String.format('%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS%Tp ', 
$latestEvent.eventTime)

 

Sample output:

2017-02-07T13:14:02PM

 

Let us say you do not need AM/PM at the end of the date, the format is:

#set( $String = '' )
$String.format('%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS ', 
$latestEvent.eventTime)

 

Sample output:

2017-02-07T13:23:06

  

Resources: http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#dt

  

Currently it is not possible to convert from one timezone to another, for example from PST to UTC.

 

Comments
cebrail.inanç
Explorer

How to convert for slack?

 

Version history
Last update:
‎12-21-2018 05:01 PM
Updated by:
Ask the Experts Session: Hybrid Application Monitoring Deployment

Join us on Feb 26 to explore Splunk AppDynamics deployment strategies, SaaS models, agent rollout plans, and expert best practices.


Register Now

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


Read the blog here