virap1 Posted August 19 Posted August 19 Hello. The api documentation says that for creating a database record we can pass the date as datetime. When I try to pass the date formatted like this 2024-08-18T19:19:06Z it does not seem to work and the record shows the current date. Every other field, aspect of rest api works fine. Am I doing something wrong? Thanks. bernhara 1
teraßyte Posted August 19 Posted August 19 That should be a valid format. 🤔 Maybe try only with the date to see if that works first? 2024-08-18 virap1 1
virap1 Posted August 22 Author Posted August 22 On 8/19/2024 at 8:08 AM, teraßyte said: That should be a valid format. 🤔 Maybe try only with the date to see if that works first? 2024-08-18 Thank you. This would not be an ideal solution for me, but even this did not work. Does anyone else have this issue? Any solutions.
Daniel F Posted September 6 Posted September 6 Could you share the full request that you're sending to the community, so that I can take a look at this?
virap1 Posted September 7 Author Posted September 7 (edited) Thank you @Daniel F. That part of the code looks like this: $date_tmp = new DateTime(); $date_tmp->modify('-24 hours'); //$formattedDate = $date_tmp->format('Y-m-d\TH:i:s\Z'); $formattedDate = $date_tmp->format('Y-m-d'); $data2 = array( "status" => "published", "category" => $cat_id, "author" => $author, "fields" => $fields2, "image" => $zzz_image, "date" => $formattedDate, "hidden" => 1, ); $curl2 = curl_init( $communityUrl . 'cms/records/7' ); You will notice there are 2 formattedDate variations, one is commented out. Neither one worked for me. Edited September 7 by virap1
Recommended Posts