Skip to content

Commit 0658228

Browse files
author
Yoan Blanc
committed
dateutil: add test case for second format.
Signed-off-by: Yoan Blanc <yoan.blanc@exoscale.ch>
1 parent 788456c commit 0658228

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

utils/src/test/java/com/cloud/utils/DateUtilTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ public static void main(String[] args) {
5555
} catch (ParseException e) {
5656
System.err.println("Parsing failed\n string : " + str + "\nexception :" + e.getLocalizedMessage());
5757
}
58+
59+
dfDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
60+
str = dfDate.format(time);
61+
System.out.println("Formated TZ time string : " + str);
62+
try {
63+
Date dtParsed = DateUtil.parseTZDateString(str);
64+
System.out.println("Parsed TZ time string : " + dtParsed.toString());
65+
} catch (ParseException e) {
66+
System.err.println("Parsing failed\n string : " + str + "\nexception :" + e.getLocalizedMessage());
67+
}
5868
}
5969

6070
}

0 commit comments

Comments
 (0)