We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d7a9d8 commit e0cc971Copy full SHA for e0cc971
1 file changed
utils/src/main/java/com/cloud/utils/DateUtil.java
@@ -38,10 +38,14 @@ public static Date currentGMTTime() {
38
return new Date();
39
}
40
41
- // yyyy-MM-ddTHH:mm:ssZxxxx
+ // yyyy-MM-ddTHH:mm:ssZZZZ or yyyy-MM-ddTHH:mm:ssZxxxx
42
public static Date parseTZDateString(String str) throws ParseException {
43
- DateFormat dfParse = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'Z");
44
- return dfParse.parse(str);
+ try {
+ return s_outputFormat.parse(str);
45
+ } catch (ParseException e) {
46
+ DateFormat dfParse = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'Z");
47
+ return dfParse.parse(str);
48
+ }
49
50
51
public static Date parseDateString(TimeZone tz, String dateString) {
0 commit comments