aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java')
-rw-r--r--common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java
index 1e219b784..dbc9faba6 100644
--- a/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java
+++ b/common/src/main/java/at/gv/egovernment/moa/util/DateTimeUtils.java
@@ -107,6 +107,20 @@ public class DateTimeUtils {
}
/**
+ * Builds a <code>dateTime</code> value in UTC from a <code>Calendar</code> value.
+ * @param cal the <code>Calendar</code> value
+ * @return the <code>dateTime</code> value
+ */
+ public static String buildDateTimeUTC(Date cal) {
+
+ SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
+ f.setTimeZone(TimeZone.getTimeZone("UTC"));
+
+ return f.format(cal);
+
+ }
+
+ /**
* Builds a <code>dateTime</code> value from a <code>Calendar</code> value.
* @param cal the <code>Calendar</code> value
* @return the <code>dateTime</code> value