Print Date & Time in HTML Email

Dear Team,

I have configured HTML Template to send email, everything is working fine except Date & Time Filed. Please guide how can we get Date & Time in HTML email.

Hi @kundan.jha,

You can add variable in your HTML similar to Plain text format using {{VariableName}}.
This will create a VariableName variable below which you can add formula to set date. You can either give Date formula here directly that will be based Server Time which is in UTC TimeZone OR if you need based datetime based on End User’s local time then you should make use of control from screen

Formula used below to get current date time.


Sample Output - 11-07-2020 18:44

If you want end user’s timezone then you should add a Text control on your Screen and apply this formula


Alternatively, if your DateTime is referenced from DateTime control then you can even give its reference like to the same Text control as shown below-

DATESTR(datetimepicker-TIMEOFFSET(),"DD-MM-YYYY HH:mm")

Where - datetimepicker is the unique name of datetimepicker control

Now you can use the above Text control in your Email tasks formula field.

For more information on DATESTR refer this
For All Custom function list you can refer this

Please Note -
DateTime control gives - Unix Time output
TODAY() gives Date object output
DATESTR() accepts Date object OR Unix time as input and Converts to String Text with given output format
TIMEOFFSET() gives device’s timezone offset
STRTOUNIX() accepts Date object OR String Date and converts to unix time output

Hope this helps!