When rendering email messages, by default the API uses date-time format and time-zone based on system default settings. You can set your date-time format and set time-zone offset when rendering to HTML.
The following are the steps to set date-time and time zones for email message:
The following code sample shows how to use custom date-time and a time-zone offset.
try(Viewerviewer=newViewer("sample.eml")){HtmlViewOptionsviewOptions=HtmlViewOptions.forEmbeddedResources("result_{0}.html");viewOptions.getEmailOptions().setDateTimeFormat("MM d yyyy HH:mm tt zzz");// Time zone offset for 1 hour
viewOptions.getEmailOptions().setTimeZoneOffset(TimeZone.getTimeZone("GMT+1"));viewer.view(viewOptions);}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.