Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Email Template : Browser DateTime instead of UTC

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on January 29 2020 at 19:35 UTC

What config value do I use to insert my local time in an email template?

When I send out an email, I want to display in the email body, the date and time that the email was fired.

And I want that time to be in my local time, not UTC.


I tried using the following code but it returns the UTC not local time.

${new Date().format('MM-dd-yyyy hh:mm a',TimeZone.getTimeZone(' EST5EDT'))}

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.
2 REPLIES 2

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on February 14 2020 at 02:51 UTC

Hi Anand,


As i understand from the query, the requirement is to insert the time the email was triggered and the time should be the servers time zone from which the email trigger was originated.


Thanks

Ajay

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.

Community_User
Saviynt Employee
Saviynt Employee
Originally posted on February 19 2020 at 18:08 UTC

Hi Anand,


I had to used a different from UTC as well in a different context (importing users from a connected app), and I came up with this sample code to get the Pacific time zone (which I updated to have same format as yours).

${(new Date()).format("MM-dd-yyyy hh:mm a",TimeZone.getTimeZone("PST"))}

I configured an email template locally and I got the below result :

image

Besides, I do see a space character before 'EST5EDT' which might cause an issue with your code.


Please find below a list of all available TimeZones :

https://garygregory.wordpress.com/2013/06/18/what-are-the-java-timezone-ids/


Regards,

Adrien.

This message was previously posted on Saviynt's legacy forum by a community user and has been moved over to this forum for continued exposure.