This guide covers how to control locale and timezone when generating documents — so dates, numbers, and timestamps render correctly for the audience receiving the document. It assumes you're already familiar with the basic generation flow covered in Generate Document.
Both values are set on the document object in a generation request, alongside output format and delivery settings:
{
"template": { ... },
"data": { ... },
"document": {
"name": "signed-contract",
"fileFormat": "pdf",
"deliveryMethod": "Storage",
"path": "root",
"locale": "en",
"timezone": "Europe/Dublin"
}
}en, de, fr) controlling how numbers, currency, and dates are formatted in the outputEurope/Dublin, America/New_York) controlling how date and time values are displayedSee the Locales Reference for the complete list of accepted locale codes and timezone identifiers.
Locale and timezone affect more than just the final render — they also affect how date() parses string values inside expressions, as covered in the Expressions Reference. To avoid mismatches, keep three things aligned to the same locale and timezone:
locale and timezone values on the document object match the other twoDate parsing inside expressions is locale-dependent — the same string can resolve to a different date depending on the active locale. If your data, template, and request locale don't agree, dates can silently parse incorrectly rather than throwing an error. Always verify the rendered output when introducing a new locale.
To generate the same template and data for a different audience, change only the document.locale and document.timezone values — everything else in the request stays the same:
{
"document": {
"name": "signed-contract",
"fileFormat": "pdf",
"deliveryMethod": "Storage",
"path": "root",
"locale": "de",
"timezone": "Europe/Berlin"
}
}If your data or template contain locale-specific formatting of their own (for example, a date already formatted as a display string rather than passed through an expression), those won't automatically adapt — only values run through format() or similar expressions at generation time follow the request's locale and timezone.
locale and timezone are set on a generation requestdocument object