From 04fc7c4bea9b4efa38a7398b6db56a8fe5273bfb Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Mon, 30 May 2022 09:00:36 -0400 Subject: Add conversions to ISO-8601 date format --- include/qpdf/QUtil.hh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh index 283db861..32aeae1f 100644 --- a/include/qpdf/QUtil.hh +++ b/include/qpdf/QUtil.hh @@ -284,6 +284,10 @@ namespace QUtil QPDF_DLL std::string qpdf_time_to_pdf_time(QPDFTime const&); + // Convert QPDFTime to a second-granularity ISO-8601 timestamp. + QPDF_DLL + std::string qpdf_time_to_iso8601(QPDFTime const&); + // Convert a PDF timestamp string to a QPDFTime. If syntactically // valid, return true and fill in qtm. If not valid, return false, // and do not modify qtm. If qtm is null, just check the validity @@ -291,6 +295,11 @@ namespace QUtil QPDF_DLL bool pdf_time_to_qpdf_time(std::string const&, QPDFTime* qtm = nullptr); + // Convert PDF timestamp to a second-granularity ISO-8601 + // timestamp. If syntactically valid, return true and initialize + // iso8601. Otherwise, return false. + bool pdf_time_to_iso8601(std::string const& pdf_time, std::string& iso8601); + // Return a string containing the byte representation of the UTF-8 // encoding for the unicode value passed in. QPDF_DLL -- cgit v1.2.3-54-g00ecf