From 8fbc8579f2481dc3eeb962e99522047291e16fbe Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 11 Feb 2021 06:51:21 -0500 Subject: Allow zone information to be omitted from timestamp strings --- libtests/qutil.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libtests/qutil.cc') diff --git a/libtests/qutil.cc b/libtests/qutil.cc index b67b7580..965c4352 100644 --- a/libtests/qutil.cc +++ b/libtests/qutil.cc @@ -594,6 +594,10 @@ void timestamp_test() check(QUtil::QPDFTime(2021, 2, 10, 1, 19, 25, -330)); check(QUtil::QPDFTime(2021, 2, 9, 19, 19, 25, 0)); assert(! QUtil::pdf_time_to_qpdf_time("potato")); + assert(QUtil::pdf_time_to_qpdf_time("D:20210211064743Z")); + assert(QUtil::pdf_time_to_qpdf_time("D:20210211064743-05'00'")); + assert(QUtil::pdf_time_to_qpdf_time("D:20210211064743+05'30'")); + assert(QUtil::pdf_time_to_qpdf_time("D:20210211064743")); // Round trip on the current time without actually printing it. // Manual testing was done to ensure that we are actually getting // back the current time in various timezones. -- cgit v1.2.3-54-g00ecf