NIFI-2584 Fixing date format in PutSQL

This closes #878.

Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
Peter Wicks 2016-08-16 19:16:44 -06:00 committed by Bryan Bende
parent 3d1a24ab7d
commit 7bc7b7f683
No known key found for this signature in database
GPG Key ID: A0DDA9ED50711C39
2 changed files with 4 additions and 4 deletions

View File

@ -779,7 +779,7 @@ public class PutSQL extends AbstractProcessor {
if(LONG_PATTERN.matcher(parameterValue).matches()){
lTimestamp = Long.parseLong(parameterValue);
}else {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
java.util.Date parsedDate = dateFormat.parse(parameterValue);
lTimestamp = parsedDate.getTime();
}

View File

@ -276,9 +276,9 @@ public class TestPutSQL {
runner.enableControllerService(service);
runner.setProperty(PutSQL.CONNECTION_POOL, "dbcp");
final String arg2TS = "2001-01-01 23:01:01.001";
final String art3TS = "2002-02-02 22:02:02.002";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSS");
final String arg2TS = "2001-01-01 00:01:01.001";
final String art3TS = "2002-02-02 12:02:02.002";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
java.util.Date parsedDate = dateFormat.parse(arg2TS);
final Map<String, String> attributes = new HashMap<>();