getDateTimeInstance方法——获取日期/时间格式器
https://book.2cto.com/201309/31514.html
@RequestMapping("/hi")
public String hello(Locale locale, Model model) {
model.addAttribute("greeting","哈罗");
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String format = dateFormat.format(date);
model.addAttribute("currentTime",format);
return "hello";
}
现在时间是 June 13, 2019 9:14:07 AM CST
获得时间 June 13, 2019 9:14:07 AM CST
浙公网安备 33010602011771号