CurrDateTime Behaving diffrerent format

Hi,

I am using currDateTime built in function to store the start date and end date in DateTime type.

I am storing the correct Date time into the DB table but when I am sending it to REST service call I am getting Extra there. Because of validation on Serivce API I am getting error.

I am passing whole aggregate list as a input to client action and on service action I am mapping and appending as per JSON structure required for service call.

Still I am getting extra Z at the end of the value also I am getting different time there. As I am passing client (Device Date time).

Could you please help me for this as I am block with development.


Many Thanks

Dileep

Request:

2019-05-13 08:21:09SKPMobile
Boxputaway Request ----{"resultsType":"COMPLETE","downloadBatchId":"882880118","activityParamList":[{"name":"DISTRICT_ID","value":"X"},{"name":"BUILDING_ID","value":"04"},{"name":"PRINTER_BATCH","value":"CORppdob"},{"name":"PRINTER_LABEL","value":"Zebra"},{"name":"PRINTER_REPORT","value":"Corp2flr"},{"name":"BOXES_TO_SCAN_PER_COLUMN","value":"6"}],"groupAssetsDataList":[{"parsedBarcode":"11111111","barcode":"11111111","scannedBarcodeType":"COLUMN","itemId":"2_11111111","isGroup":true,"groupType":"COLUMN","assetType":"NOT_SET","order":-1,"comment":"scanned column","commentType":"USER_INPUT","isScanned":true,"isComplete":true,"hasUnexpectedChildren":false,"isUnexpected":false,"globalScanNumber":"2","isSelected":true,"startDateTime":"2019-05-13T12:21:01Z","endDateTime":"2019-05-13T12:21:01Z","unparsedBarcode":"11111111","parentGroupType":"NOT_SET","parentBarcode":"NOT_SET","groupAssetDataExtensonList":[]},{"parsedBarcode":"12122222","barcode":"12122222","scannedBarcodeType":"COLUMN","itemId":"1_12122222","isGroup":true,"groupType":"COLUMN","assetType":"NOT_SET","order":-1,"comment":"scanned column","commentType":"USER_INPUT","isScanned":true,"isComplete":true,"hasUnexpectedChildren":false,"isUnexpected":false,"globalScanNumber":"1","isSelected":true,"startDateTime":"2019-05-13T11:46:42Z","endDateTime":"2019-05-13T11:46:42Z","unparsedBarcode":"12122222","parentGroupType":"NOT_SET","parentBarcode":"NOT_SET","groupAssetDataExtensonList":[]},{"parsedBarcode":"1111","barcode":"T1111","scannedBarcodeType":"BOX","itemId":"2_T1111","isGroup":false,"groupType":"NOT_SET","assetType":"BOX","order":-1,"comment":"scanned box","commentType":"USER_INPUT","isScanned":true,"isComplete":true,"hasUnexpectedChildren":false,"isUnexpected":false,"globalScanNumber":"2","isSelected":true,"startDateTime":"2019-05-13T12:21:05Z","endDateTime":"2019-05-13T12:21:05Z","unparsedBarcode":"T1111","parentGroupType":"COLUMN","parentBarcode":"11111111","groupAssetDataExtensonList":[]},{"parsedBarcode":"1

Response:

2019-05-13 08:21:10SKPMobile
{"status":{"success":false,"httpStatus":400},"errors":[{"code":"MDS_RSLT_064","message":"Invalid dateformat 2019-05-13T11:46:44Z provided at position arg0.groupAssetsDataList[3].startDateTime. It should be in 2019-05-10T15:30:30-05:00","key":"service.results.user.session.expired"},{"code":"MDS_RSLT_064","message":"Invalid dateformat 2019-05-13T12:21:01Z provided at position arg0.groupAssetsDataList[0].startDateTime. It should be in 2019-05-10T15:30:30-05:00","key":"service.results.user.session.expired"},{"code":"MDS_RSLT_064","message":"Invalid dateformat 2019-05-13T11:46:42Z provided at position arg0.groupAssetsDataList[1].endDateTime. It should be in 2019-05-10T15:30:30-05:00","key":"service.results.user.session.expired"},{"code":"MDS_RSLT_064","message":"Invalid dateformat 2019-05-13T12:21:01Z provided at position arg0.groupAssetsDataList[0].endDateTime. It should be in 2019-05-10T15:30:30-05:00","key":"service.results.user.session.expired"},{"code":"MDS_RSLT_064","message":"Invalid dateformat 2019-05-13T11:46:42Z provided at position arg0.groupAssetsDataList[1].startDateTime. It should be in 2019-05-10T15:30:30-05:00","key":"service.results.user.session.expired"},{"code":"MDS_RSLT_064","message":"Invalid dateformat 2019-05-13T12:21:05Z provided at position arg0.groupAssetsDataList[2].startDateTime. It should be in 2019-05-10T15:30:30-05:00","key":"service.results.user.session.expired"},{"code":"MDS_RSLT_064","message":"Invalid dateformat 2019-05-13T11:46:44Z provided at position arg0.groupAssetsDataList[3].endDateTime. It should be in 2019-05-10T15:30:30-05:00","key":"service.results.user.session.expired"},{"code":"MDS_RSLT_064","message":"Invalid dateformat 2019-05-13T12:21:05Z provided at position arg0.groupAssetsDataList[2].endDateTime. It should be in 2019-05-10T15:30:30-05:00","key":"service.results.user.session.expired"}]}

Hi Dileep,

The extra "Z" means the date/time is UTC. When sending date/time variables via REST, the Platform converts them to UTC. Any service that does not recognize this is, to say the least, highly questionable. The "Z" is an international, widely recognizable standard.

Kilian Hekhuis wrote:

Hi Kilian,

Thanks for prompt reply. I will discuss this with my service team.

In between I want to send device time to the service from Local Databse stored not the different time, as I am seeing the differences in time also.

Could you please help me on this.


Also Is there any solution if I dont want to send extra Z to REST service call?


Thanks

Dileep

The extra "Z" means the date/time is UTC. When sending date/time variables via REST, the Platform converts them to UTC. Any service that does not recognize this is, to say the least, highly questionable. The "Z" is an international, widely recognizable standard.



Hi Dileep,

You could of course make the Attribute of type Text instead of Date Time, and create a date/time string yourself.