Skip to content

Commit

Permalink
Fix for Timestamp with Time Zone datatype (formatting) - amazon-archi…
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrugz committed May 16, 2019
1 parent 201bc08 commit 6fe6ff0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ public java.sql.Timestamp asTimestamp(String value, Calendar calendar) throws SQ
}
// Timestamp.valueOf() does not like timezone information
if (value.length() > 23) {
if(value.length() == 24 && value.charAt(23) == 'Z') {
if (value.length() == 24 && value.charAt(23) == 'Z') {
value = value.substring(0, 23);
}
else if(value.charAt(23) == '+' || value.charAt(23) == '-') {
else if (value.charAt(23) == '+' || value.charAt(23) == '-') {
// 'calendar' parameter takes precedence
if(calendar==null) {
calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"+value.substring(23)));
if (calendar == null) {
calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT" + value.substring(23)));
}
value = value.substring(0, 23);
}
Expand Down

0 comments on commit 6fe6ff0

Please sign in to comment.