try {
String timezone = getTz(getDateString(a));
if (timezone.compareTo("\"Z\"") == 0) {
return "\"PT0S\"";
} else if (timezone.compareTo("\"\"") == 0) {
throw new TypeErrorException();
} else {
timezone = Helper
.unquote(timezone);
String result = "\"";
if (timezone.startsWith("-")) {
result += "-";
timezone = timezone.substring(1);
} else if (timezone.startsWith("+")) {
result += "+";
timezone = timezone.substring(1);
}
result += "PT";
Character c = timezone.charAt(0);
if (Character.isDigit(c)) {
if (c != '0') {
result += c.toString();
}
timezone = timezone.substring(1);
c = timezone.charAt(0);
if (Character.isDigit(c)) {
result += c.toString();
}
result += "H";
}
result += "\"";
return result;
}
} catch (Exception e) {
// ignore...
}
throw new TypeErrorException();
}