You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Change Z to +0000 to adapt the string to a format
54
+
// Change Z to adapt the string to a format
55
55
// that can be parsed in Java
56
56
finalbooleanhasZ = strVal.indexOf('Z') != -1;
57
+
finalbooleanhasDot = strVal.indexOf('.') != -1;
58
+
57
59
StringmodifiedStrVal;
58
60
finalStringzSuffix;
59
-
if (hasZ) {
61
+
if (hasZ && hasDot) {
62
+
zSuffix = "";
63
+
modifiedStrVal = strVal.replace("Z", "+00:00");
64
+
} elseif (hasZ && !hasDot) {
60
65
zSuffix = "Z";
61
66
modifiedStrVal = strVal.replace("Z", "+0000");
62
67
} else {
63
68
zSuffix = "";
64
69
modifiedStrVal = strVal;
65
70
}
66
-
67
-
// Parse the well-formatted date string.
71
+
72
+
// Parse the well-formatted date string with and without offsets (eg: 2019-06-21T17:12:35.138, 2019-06-21T17:12:35.138+0000, 2019-06-21T17:12:35.138-07:00)
0 commit comments