skip to Main Content

Unable to convert DateTime timestamp to m/d/y format – PHP

So I am using an API and I am getting the following updatedOn response: "UpdatedOn": "/Date(1674542180860+0000)/". I am using the following code to convert it to m/d/y format: if (!empty($data->Data->Shipment->UpdatedOn)): $timestamp = preg_replace('/[^0-9+-]/', '', $data->Data->Shipment->UpdatedOn); $date = new DateTime("@$timestamp"); $timestamp…

VIEW QUESTION
Back To Top
Search