Binding variable to print current date and time(UTC format) in email template

Bhargav
New Contributor
New Contributor

Hello Team,

We have a requirement to print current date and time (UTC format) in email template like below format

Bhargav_0-1694151283445.png

Can someone help me with proper binding variable?

Thanks,

Bhargav.

 

4 REPLIES 4

armaanzahir
Valued Contributor
Valued Contributor

Hi @Bhargav 

Can you try using the following:

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

Below is a list of all available timezones:

What are the Java TimeZone IDs? | Gary Gregory (wordpress.com)

 

Regards,
Md Armaan Zahir

nimitdave
Saviynt Employee
Saviynt Employee

@Bhargav please try below:

${(new Date()).format('yyyy-MM-dd'T'HH:mm:ss',TimeZone.getTimeZone("UTC"))}

Bhargav
New Contributor
New Contributor

Thank you @nimitdave @armaanzahir 

Also I have attached email template in Analytics. Once we run the Analytics or Analytics job, for every trigger it's sending 2 emails. It should send only one email for each trigger.

What might be the issue and how can we achieve this?

 

Thanks,

Bhargav.

Bhargav
New Contributor
New Contributor

Dear Team,

For use in email templates, can someone assist me with binding a variable for the date format of -  15th Sept 2023 ?

Regards,

Bhargav.