Skip to content

modern-pdf-lib


modern-pdf-lib / formatPdfDate

Function: formatPdfDate()

formatPdfDate(date): string

Defined in: src/core/pdfCatalog.ts:36

Format a Date as a PDF date string.

PDF dates follow the form: D:YYYYMMDDHHmmSSOHH'mm

  • O is the relationship to UT: +, -, or Z.
  • The trailing HH'mm is the UT offset.

Parameters

date

Date

A JavaScript Date object.

Returns

string

A PDF date string wrapped in parentheses.

Released under the MIT License.