From b3b58d9be6c3f5dd7e26c67d406cefbf8bf87110 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 18 Jun 2014 12:21:01 +0200 Subject: Fixing timestamp format always convert to UTC Zulu Time (issue: #21) --- .../java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pdf-as-lib/src/main/java') diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java index 16f23759..435ef5a3 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java @@ -25,6 +25,7 @@ package at.gv.egiz.pdfas.lib.impl.stamping; import java.text.SimpleDateFormat; import java.util.Calendar; +import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -66,11 +67,12 @@ public class ValueResolver implements IProfileConstants, IResolver { logger.debug("Resolving value with value: " + value); if (key.equals(SIG_DATE)) { - if (value == null) { - value = defaultDateFormat; - } + //if (value == null) { + value = defaultDateFormat; + //} // Value holds the date format! SimpleDateFormat formater = new SimpleDateFormat(value); + formater.setTimeZone(TimeZone.getTimeZone("UTC")); Calendar cal = Calendar.getInstance(); return formater.format(cal.getTime()); } -- cgit v1.2.3