PDI从系统日期变量中减去1分钟

问题描述 投票:0回答:1

我正在尝试使用PDI从默认系统日期(可变)中减去1分钟或60秒。我将此命令连接到计算器步骤。但这给了我一个错误或没有时间值

2020/04/20 11:51:00 - Calculator.0 - ERROR (version 9.0.0.0-423, build 9.0.0.0-423 from 2020-01-31 04.53.04 by buildguy) : Unexpected error
2020/04/20 11:51:00 - Calculator.0 - ERROR (version 9.0.0.0-423, build 9.0.0.0-423 from 2020-01-31 04.53.04 by buildguy) : org.pentaho.di.core.exception.KettleStepException: 
2020/04/20 11:51:00 - Calculator.0 - Unable to find the second argument field 'test for calculation #1
2020/04/20 11:51:00 - Calculator.0 - 
2020/04/20 11:51:00 - Calculator.0 -    at org.pentaho.di.trans.steps.calculator.Calculator.processRow(Calculator.java:133)
2020/04/20 11:51:00 - Calculator.0 -    at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2020/04/20 11:51:00 - Calculator.0 -    at java.lang.Thread.run(Thread.java:748)

enter image description here

pentaho pentaho-data-integration pdi
1个回答
0
投票

使用Modified Java Script Value

enter image description here

MyTime是固定的系统日期。需要添加以下代码段

var MyNewTime;

MyNewTime = MyTime.setMinutes(MyTime.getMinutes());
MyNewTime = new Date(MyTime);
MyNewTime.setMinutes(MyTime.getMinutes() - 1);
© www.soinside.com 2019 - 2024. All rights reserved.