|
|
|
@ -7,12 +7,8 @@ import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.time.ZonedDateTime; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.LinkedHashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.TimeZone; |
|
|
|
|
|
|
|
@RestController |
|
|
|
@ -23,21 +19,6 @@ public class HomeController { |
|
|
|
*/ |
|
|
|
@RequestMapping({"/",""}) |
|
|
|
public JSONObject home(){ |
|
|
|
// output current time
|
|
|
|
// ask jdk gt 1.8+
|
|
|
|
// // get localtime
|
|
|
|
// ZoneId zoneId = ZoneId.of("America/New_York");
|
|
|
|
// // get current time
|
|
|
|
// ZonedDateTime zonedDateTime = ZonedDateTime.now();
|
|
|
|
// // convert to US. time format
|
|
|
|
// ZonedDateTime ustime = zonedDateTime.withZoneSameInstant(zoneId);
|
|
|
|
// //
|
|
|
|
// DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
//
|
|
|
|
// String format = zonedDateTime .format(dateFormat);
|
|
|
|
// return AjaxResult.success(format);
|
|
|
|
//*************************************************************
|
|
|
|
|
|
|
|
// 设置时区为美国
|
|
|
|
TimeZone timeZone = TimeZone.getTimeZone("America/New_York"); |
|
|
|
// 创建 SimpleDateFormat 对象,指定日期格式
|
|
|
|
|