I want to report the event time in an email template using the international standard time format. How can I do this?
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.
How to convert for slack?