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

Send timestamp array parameter to PostgreSQL function

i have developed a pgplsql function to receive array of dates the return the maximum date, but its not able to call the function: select 1, arcfm.array_max_date('{2022-02-03, 2022-06-05}'::timestamp[]) as max_date_time; CREATE OR REPLACE FUNCTION arcfm.array_max_date(in dates_array timestamp[])     RETURNS timestamp     LANGUAGE…

VIEW QUESTION
Back To Top
Search