Date dt =new Date();
String formatDate = null;
formatDate = DateFormat.getDateInstance().format(dt);
zjTask.setEndTime(formatDate.toString());
完整
/**
* 结束任务获取当时时间
* getZjTaskEndTime
*/
@AutoLog(value = " 结束任务获取当时时间")
@ApiOperation(value=" 结束任务获取当时时间", notes="结束任务获取当时时间")
@GetMapping(value = "/getZjTaskEndTime")
public Result<?> getZjTaskEndTime(String zjName ,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
ZjTask zjTask = zjTaskService.getById(zjName);
Date dt =new Date();
String formatDate = null;
formatDate = DateFormat.getDateInstance().format(dt);
zjTask.setEndTime(formatDate.toString());
zjTaskService.updateById(zjTask);
return Result.ok(zjTask);
}