mirror of
https://github.com/apache/nifi.git
synced 2025-02-16 06:55:28 +00:00
NIFI-2584 Fixing date format in PutSQL
This closes #878. Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
parent
3d1a24ab7d
commit
7bc7b7f683
@ -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();
|
||||
}
|
||||
|
@ -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<>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user