public static XMLGregorianCalendar getXMLEventTime(ZonedDateTime zonedDateTime) {
XMLGregorianCalendar xmlGregorianCalendar = null;
if(zonedDateTime!=null) {
GregorianCalendar gregorianCalendar = new GregorianCalendar();
gregorianCalendar.setTime(getDateFromZonedDateTime(zonedDateTime));
xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
}
return xmlGregorianCalendar;
}
我想以“2020-05-06T16:58:38.517+00:00”格式输出,但在 UTC 中将这个“2020-05-06T16:58:38.517Z”作为我的服务器。
当我在本地(IST 时区)运行应用程序时,我得到了正确的输出“2020-05-06T16:58:38.517+05:30”,但在 UTC 时区中同样不起作用