]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/output/template/Template.java
fix: output DoB as date-only
[gigi.git] / src / org / cacert / gigi / output / template / Template.java
index da94098afca208430009e59b0fcfa89c6dab1acf..858b04806bcbe9e2591682492f1512936f6472f3 100644 (file)
@@ -9,6 +9,7 @@ import java.io.PrintWriter;
 import java.io.Reader;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.LinkedList;
 import java.util.Map;
@@ -189,8 +190,12 @@ public class Template implements Outputable {
         }
         if (s instanceof Outputable) {
             ((Outputable) s).output(out, l, vars);
-        } else if (s instanceof Date) {
+        } else if (s instanceof java.sql.Date) {
             out.print(DateSelector.getDateFormat().format(s));
+        } else if (s instanceof Date) {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            out.print(sdf.format(s));
+            out.print(" UTC");
         } else {
             out.print(s == null ? "null" : (unescaped ? s.toString() : HTMLEncoder.encodeHTML(s.toString())));
         }