Skip to content

Commit

Permalink
0000722: Sync of a date field on the source to a datetime field on a …
Browse files Browse the repository at this point in the history
…target fails
  • Loading branch information
chenson42 committed Jul 22, 2012
1 parent 55b1b94 commit b8fb01f
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -519,11 +519,16 @@ protected java.util.Date parseDate(int type, String value, boolean useVariableDa
return new Date(time);
} else {
if (useTimestamp) {
return Timestamp.valueOf(value);
try {
return Timestamp.valueOf(value);
} catch (IllegalArgumentException ex) {
return DateUtils.parseDate(value, TIMESTAMP_PATTERNS);
}
} else if (type == Types.TIME) {
return DateUtils.parseDate(value, TIME_PATTERNS);
} else {
return DateUtils.parseDate(value, TIMESTAMP_PATTERNS);
}
return DateUtils.parseDate(value, TIMESTAMP_PATTERNS);
}
} catch (Exception e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit b8fb01f

Please sign in to comment.