我从json格式的数据库中获取数据。本地日期时间有问题
{“ dayOfMonth”:4,“ dayOfWeek”:1,“ era”:1,“ year”:2017,“ dayOfYear”:247,“ chronology”:{“ zone”:{“ fixed”:true, “ id”:“ UTC”}},“ weekOfWeekyear”:36,“ millisOfSecond”:0,“ secondOfMinute”:0:“ centuryOfEra”:20,“ yearOfEra”:2017,“ yearOfCentury”:17,“ weekyear”: 2017,“ monthOfYear”:9,“ millisOfDay”:0,“ minuteOfHour”:0,“ hourOfDay”:0,“ fields”:[{“ lenient”:false,“ maximumValue”:292278993,“ minimumValue”:-292275054 ,“ rangeDurationField”:null,“ leapDurationField”:{“ precise”:true,“ unitMillis”:86400000,“ name”:“ days”,“ type”:{“ name”:“ days”},“ supported”: true},“ durationField”:{“ precise”:false,“ unitMillis”:31556952000,“ name”:“ years”,“ type”:{“ name”:“ years”},“ supported”:true},“ name“:” year“,” type“:{” rangeDurationType“:null,” durationType“:{” name“:” years“},” name“:” year“},” supported“:true},{” lenient“:false,” maximumValue“:12,” minimumValue“:1,” rangeDurationField“:{” precise“:false,” unitMillis“:31556952000,” name“:” years“,” type“:{” name“ :“ years”},“ supported”:true},“ leapDurationField”:{“ precise”:true,“ unitMillis”:86400000,“ name”:“ days”,“ typ e“:{” name“:” days“},” supported“:true},” durationField“:{” precise“:false,” unitMillis“:2629746000,” name“:” months“,” type“:{ “ name”:“ months”},“ supported”:true},“ name”:“ monthOfYear”,“ type”:{“ rangeDurationType”:{“ name”:“ years”},“ durationType”:{“ name “:” months“},” name“:” monthOfYear“},” supported“:true},{” maximumValue“:31,” minimumValue“:1,” rangeDurationField“:{” precise“:false,” unitMillis“ :2629746000,“名称”:“月”,“类型”:{“名称”:“月”},“受支持”:true},“宽松”:false,“ durationField”:{“精确”:true,“ unitMillis“:86400000,” name“:” days“,” type“:{” name“:” days“},” supported“:true},” unitMillis“:86400000,” name“:” dayOfMonth“,” type “:{” rangeDurationType“:{” name“:” months“},” durationType“:{” name“:” days“},” name“:” dayOfMonth“},” supported“:true,” leapDurationField“: null},{“ range”:86400000,“ maximumValue”:86399999,“ rangeDurationField”:{“ precise”:true,“ unitMillis”:86400000,“ name”:“ days”,“ type”:{“ name”: “ days”},“ supported”:true},“ lenient”:false,“ durationField”:{“ name”:“ millis”,“ type”:{“ name”:“ millis”},“ supported”:t rue,“ precise”:true,“ unitMillis”:1},“ minimumValue”:0,“ unitMillis”:1,“ name”:“ millisOfDay”,“ type”:{“ rangeDurationType”:{“ name”:“ days“},” durationType“:{” name“:” millis“},” name“:” millisOfDay“},” supported“:true,” leapDurationField“:null}],” fieldTypes“:[{” rangeDurationType“ :null,“ durationType”:{“ name”:“ years”},“ name”:“ year”},{“ rangeDurationType”:{“ name”:“ years”},“ durationType”:{“ name”: “ months”},“ name”:“ monthOfYear”},{“ rangeDurationType”:{“ name”:“ months”},“ durationType”:{“ name”:“ days”},“ name”:“ dayOfMonth” },{“ rangeDurationType”:{“ name”:“ days”},“ durationType”:{“ name”:“ millis”},“ name”:“ millisOfDay”}],“ values”:[2017,9, 4,0]}},{“ reg_id”:86,“ name”:“ we”,“ mobilenumber”:8099677558,“ email”:“ aa@gmail.com”,“ register_mode”:“ Offline 付费”,“评分”:0,“密码”:“ fsdfsf”,“促销模式”:null,“修复模式”:null,“ modified_by”:null,“ created_by”:null},{“ reg_id”:87”名称“:” adfdsfdsf“,”手机号码“:5444445555,”电子邮件“:” sadfsdafds@gmial.com“,” register_mode“:”在线“,”评级“:0,”密码“:null,” promo_mode“:” Notpromo”,“ repair_mode”:null,“ modified_by”:null,“ created_by”:null},
@RequestMapping(value="/getUsers", method=RequestMethod.GET, headers="Accept=application/json")
public ResponseEntity<List<RegistrationAmc>> getregistrationusers() {
HttpHeaders headers = new HttpHeaders();
List<RegistrationAmc> list = frntService.getregistrationusers();
for(RegistrationAmc r:list){
LocalDateTime localDate = new LocalDateTime();
DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy/dd/MM");
String formattedDate = formatter.print(localDate);
System.out.println("ggggg"+formattedDate);
System.out.println("ssssssssssssss....."+r);
}
if (list == null) {
return new ResponseEntity<List<RegistrationAmc>>(HttpStatus.NOT_FOUND);
}
headers.add("Number Of Records Found", String.valueOf(list.size()));
return new ResponseEntity<List<RegistrationAmc>>(list, headers, HttpStatus.OK);
}