java日期对象的默认Jsonb序列化格式是什么
jsonb默认为JavaAPI的各种日期对象使用的日期/时间格式是什么 例如,javascript的java日期对象的默认Jsonb序列化格式是什么,java,date,jsonb,Java,Date,Jsonb,jsonb默认为JavaAPI的各种日期对象使用的日期/时间格式是什么 例如,javascript的new Date().toJSON()生成的输出包含我希望使用Jsonb解析到ZonedDateTime字段的第二个分数,但默认序列化程序不支持第二个分数 是否必须指定自定义格式来映射javascriptDate?在第3.5节中指定默认映射实现应支持的日期: 实现必须支持以下标准Java日期/时间类的绑定: java.util.Date java.util.Calendar java.util.
new Date().toJSON()
生成的输出包含我希望使用Jsonb解析到ZonedDateTime
字段的第二个分数,但默认序列化程序不支持第二个分数
是否必须指定自定义格式来映射javascriptDate
?在第3.5节中指定默认映射实现应支持的日期:
实现必须支持以下标准Java日期/时间类的绑定:
- java.util.Date
- java.util.Calendar
- java.util.gregorianalendar
- java.util.TimeZone
- java.util.SimpleTimeZone
- java.time.Instant
- java.time.Duration
- java.time.Period
- java.time.LocalDate
- java.time.LocalTime
- java.time.LocalDateTime
- java.time.zoneDateTime
- java.time.ZoneId
- java.time.ZoneOffset
- java.time.OffsetDateTime
- java.time.OffsetTime
{
"date": "2016-07-27T23:07:41",
"calendar": "2016-07-27T23:07:41.782+02:00[Europe/Copenhagen]",
"gregorianCalendar": "2016-07-27T23:07:41.801+02:00[Europe/Copenhagen]",
"timeZone": "Europe/Copenhagen",
"simpleTimeZone": "Europe/Paris",
"instant": "2016-07-27T21:07:41.806Z",
"duration": "PT96H",
"period": "P3M",
"localDate": "2016-07-27",
"localTime": "23:07:41.807",
"localDateTime": "2016-07-27T23:07:41.807",
"zonedDateTime": "2016-07-27T23:07:41.807+02:00[Europe/Copenhagen]",
"zoneId": "Europe/Copenhagen",
"zoneOffset": "+03:30",
"offsetDateTime": "2016-07-27T23:07:41.807+02:00",
"offsetTime": "23:07:41.807+02:00",
}
在我的例子中,java.time.Instant
实例将从javascript的Date.toJSON()
输出字符串中正确反序列化