We have a production issue that incoming message has a field value as GMT date format, but AppConnect xmlnsc parser doesn't take the timezone, always treat as local time.
ex.: the incoming message has a field:
<gmtDateTime>2022-10-28T11:43:17.215Z</gmtDateTime>
which defines as
<xsd:element name="gmtDateTime" type="xsd:dateTime"/>
In xsd.
when the message is parsed by xmlnsc parser, the value doesn't change to local date/time, still as 2022-10-28T11:43:17.215. In debugger, I see this:
gmtDateTime:TIMESTAMP:java.util.GregorianCalendar[time=1666982597215,areFieldsSet=true,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/Los_Angeles",offset=-28800000,dstSavings=3600000,useDaylight=true,transitions=185,lastRule=java.util.SimpleTimeZone[id=America/Los_Angeles,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=?,YEAR=2022,MONTH=9,WEEK_OF_YEAR=?,WEEK_OF_MONTH=?,DAY_OF_MONTH=28,DAY_OF_YEAR=?,DAY_OF_WEEK=?,DAY_OF_WEEK_IN_MONTH=?,AM_PM=0,HOUR=11,HOUR_OF_DAY=11,MINUTE=43,SECOND=17,MILLISECOND=215,ZONE_OFFSET=?,DST_OFFSET=?]
I have tested using value as 2022-10-28T11:43:17.215 or 2022-10-28T11:43:17.215-08:00, in the debugger, I see the same result by the xmlnsc parser.
In the server.conf.yaml, i have updated as following:
ESQL:
castWithAccurateZoneOffsets: true
alwaysCastToLocal: true
XMLNSC:
invalidCharacterEscapeType: unicode
storeTimeZoneInValue: true
writeTimeZone: whenSet
wonder if you have seen this issue and what I need to do in order to parse the datetime with the timezone to correct local time.
Many thanks,
andy
------------------------------
Andy Mao
------------------------------