diff --git a/src/Handler/Shipment/GetShipmentHandler.php b/src/Handler/Shipment/GetShipmentHandler.php index 4c2878a..532372b 100644 --- a/src/Handler/Shipment/GetShipmentHandler.php +++ b/src/Handler/Shipment/GetShipmentHandler.php @@ -37,6 +37,10 @@ public function __invoke(GetShipment $getShipment): Shipment ]); $response = $response->getBody()->json(); + + // Current return includes milliseconds: 2018-12-20T11:34:50.237+01:00 + // Convert this timestamp into ISO 8601 format. + $response['shipmentDate'] = (new \DateTime($response['shipmentDate']))->format(\DateTime::ATOM); $response['shipmentItems'] = array_map(static function (array $item) { $item['latestDeliveryDate'] = (new \DateTime($item['latestDeliveryDate']))->format('Y-m-d');