X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Foutput%2FDateSelector.java;h=0728eca3e73a7d69bbaf670e1779112fc344e603;hp=f98ec8fa6993e9e349848c8f40e02f13a827adb6;hb=4df25979d16944ddfcc58752cf8b6f7da30c4bc1;hpb=b1b4d71f05e318598baba9c41295208b0aa9e2a9 diff --git a/src/org/cacert/gigi/output/DateSelector.java b/src/org/cacert/gigi/output/DateSelector.java index f98ec8fa..0728eca3 100644 --- a/src/org/cacert/gigi/output/DateSelector.java +++ b/src/org/cacert/gigi/output/DateSelector.java @@ -39,6 +39,8 @@ public class DateSelector implements Outputable { private int year; + private static ThreadLocal fmt = new ThreadLocal<>(); + @Override public void output(PrintWriter out, Language l, Map vars) { out.print(""); @@ -128,4 +130,14 @@ public class DateSelector implements Outputable { return new java.sql.Date(gc.getTime().getTime()); } + public static SimpleDateFormat getDateFormat() { + SimpleDateFormat local = fmt.get(); + if (local == null) { + local = new SimpleDateFormat("yyyy-MM-dd"); + local.setTimeZone(TimeZone.getTimeZone("UTC")); + fmt.set(local); + } + return local; + } + }