aboutsummaryrefslogtreecommitdiff
path: root/common/src
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-04-17 17:25:50 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-04-17 17:25:50 +0200
commite568d9464c43705f157ac82e8d299adcc1369049 (patch)
treee7f096d54069f6d16f66a63366caba167ccbe73f /common/src
parentede744e9af545db61a0d46f44279a4a8a216c633 (diff)
downloadmoa-id-spss-e568d9464c43705f157ac82e8d299adcc1369049.tar.gz
moa-id-spss-e568d9464c43705f157ac82e8d299adcc1369049.tar.bz2
moa-id-spss-e568d9464c43705f157ac82e8d299adcc1369049.zip
add method to build default DateTime string
Diffstat (limited to 'common/src')
-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