Introduction
This section explains how to configure date and time display in email document headers.
Displaying Date and Time Using End User's Time Zone
You can specify the time zone for rendering the date and time in email headers by using the render.html5.timeZone
parameter of the POST /ViewingSession API (PAS) or POST /PCCIS/V1/ViewingSession API (PrizmDoc Server).
IMPORTANT: This experimental parameter is a work-in-progress that is not officially supported by Accusoft. Its behavior may change at any time in a future release of the product.
NOTE: Markup burning and content conversion for a viewing session currently ignore this parameter. Results of markup burning and content conversion use the time zone defined in the server configuration.
NOTE: This parameter will be ignored if the
__experimental.fileTypes.email.renderMeetingInfo
Central Configuration parameter is set to true.
Additionally, you can adjust the formatting and the locale used for displaying date and time in email headers, using server side configuration parameters. See Server-Side Configuration for Time Zone and Date / Time format. If the time zone is specified in both the central configuration and in an API call, the API call parameter takes precedence.
Example
The following example modifies the hello-prizmdoc-viewer-with-nodejs-and-html sample to use the end user's time zone when displaying email headers:
// 1. Create a new viewing session
prizmdocRes = await pas.post('/ViewingSession', { // See https://help.accusoft.com/PrizmDoc/latest/HTML/pas-viewing-sessions.html
json: {
source: {
type: 'upload',
displayName: DOCUMENT_NAME
},
allowedClientFileFormats: clientFileFormats,
// Add this block to display email headers using end user's time zone:
render: {
html5: {
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
}
}
}
});
You would also need to put a test email document in the sample's documents
folder and update the DOCUMENT_NAME
const variable accordingly, because the sample uses a PDF test document by default.
Server-Side Configuration for Time Zone and Date / Time format
Use these central configuration parameters to adjust the display of an email "Sent" header value:
fileTypes.email.timeZone
fileTypes.email.dateFormat
fileTypes.email.timeFormat
fileTypes.email.timeZoneFormat
fileTypes.email.dateTimeLocale
fileTypes.email.renderHeaders
The Sent
header value will be composed by concatenating the message's sent date, time and time zone, separated by whitespaces. You can omit either of those parts by specifying an empty string for the corresponding format parameter.
If you want to allow your end users to view email headers in their local time zones, you can specify the time zone during the viewing session creation. See Displaying Date and Time Using End User's Time Zone for more details. If the time zone is specified in both the central configuration and in an API call, the API call parameter takes precedence.
Examples
Use Case: United States, California
The time zone is updated to match the user's time zone and the long time zone name is displayed. Other date and time configuration parameters are left at their default values.
Configuration:
fileTypes.email.timeZone: US/Pacific
fileTypes.email.timeZoneFormat: "'('zzzz')'"
The Sent
header of an email sent at January 1, 2023 15:00 US/Pacific time will display as January 1, 2023 3:00 PM (Pacific Standard Time)
The Sent
header of an email sent at July 1, 2023 15:00 US/Pacific time will display as July 1, 2023 3:00 PM (Pacific Daylight Time)
In both cases above, PrizmDoc uses the US/Pacific time zone for the display. However, in the Winter (from the first Sunday in November to the second Sunday in March) this time zone corresponds to the Pacific Standard Time (UTC-08:00), while in the Summer (from the second Sunday in March to the first Sunday in November) it corresponds to the Pacific Daylight Time (UTC-07:00).
Use Case: Mexico
The time zone is updated to match users' time zone, the locale is updated to use the 'es-MX' language tag, while the date and time formats are adjusted to match the format commonly used in Mexico. The time zone is not displayed because all users are assumed to use the same local time zone:
Configuration:
fileTypes.email.timeZone: America/Mexico_City
fileTypes.email.dateFormat: "EEEE d MMMM yyyy';'"
fileTypes.email.timeFormat: "H':'mm"
fileTypes.email.timeZoneFormat: ""
fileTypes.email.dateTimeLocale: "es-MX"
The Sent
header of an email sent at January 1, 2023 15:00 Mexico time will display as domingo 1 enero 2023; 15:00
The Sent
header of an email sent at July 1, 2023 15:00 Mexico time will display as sábado 1 julio 2023; 15:00
Use Case: International Users
The time zone is set to UTC and the date and time formats are adjusted to use an international notation:
Configuration:
fileTypes.email.timeZone: UTC
fileTypes.email.dateFormat: "yyyy'-'dd'-'MM"
fileTypes.email.timeFormat: "HH':'mm"
fileTypes.email.timeZoneFormat: "'('xxx')'"
The Sent
header of an email sent at January 1, 2023 15:00 Europe/Paris time will display as 2023-01-01 16:00 (+00:00)
The Sent
header of an email sent at July 1, 2023 15:00 Europe/Paris time will display as 2023-07-01 17:00 (+00:00)