aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-lib/src/main/java/at/gv
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-10-15 10:18:41 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-10-15 10:18:41 +0200
commit40e77eea8328ff9cef8d45b2ff3134349d7a65af (patch)
tree60549da81e9fd059900fda55c09ae0c0ec9c8592 /pdf-as-lib/src/main/java/at/gv
parent49f389e3e943dd9e1e4c9271a9e03a1ba9201b2d (diff)
downloadpdf-as-4-40e77eea8328ff9cef8d45b2ff3134349d7a65af.tar.gz
pdf-as-4-40e77eea8328ff9cef8d45b2ff3134349d7a65af.tar.bz2
pdf-as-4-40e77eea8328ff9cef8d45b2ff3134349d7a65af.zip
Signingdate added Timezone konfiguration #42
Diffstat (limited to 'pdf-as-lib/src/main/java/at/gv')
-rw-r--r--pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/impl/stamping/ValueResolver.java15
1 files changed, 11 insertions, 4 deletions
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 fc3ffef3..fd7bb0dd 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;
@@ -47,7 +48,7 @@ public class ValueResolver implements IProfileConstants, IResolver {
public static final String PatternRegex = "\\$(\\{[^\\$]*\\})";
- public static final String defaultDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
+ public static final String defaultDateFormat = "yyyy-MM-dd'T'HH:mm:ssXXX";
public static final String EXP_START = "${";
public static final String EXP_END = "}";
@@ -69,11 +70,17 @@ public class ValueResolver implements IProfileConstants, IResolver {
if (value == null) {
value = defaultDateFormat;
}
+
// Value holds the date format!
- SimpleDateFormat formater = new SimpleDateFormat(value);
- //formater.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //
+ SimpleDateFormat fdf = new SimpleDateFormat(value);
+ String timeZone = settings.getProfileTimeZone();
+
+ if(timeZone != null) {
+ fdf.setTimeZone(TimeZone.getTimeZone("timeZone"));
+ }
Calendar cal = Calendar.getInstance();
- return formater.format(cal.getTime());
+ return fdf.format(cal.getTime());
}
if (value != null) {