virap1 Posted August 19 Share 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 Link to comment Share on other sites More sharing options...
teraßyte Posted August 19 Share 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 Link to comment Share on other sites More sharing options...
virap1 Posted August 22 Author Share 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. Link to comment Share on other sites More sharing options...
Daniel F Posted September 6 Share 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? Link to comment Share on other sites More sharing options...
virap1 Posted September 7 Author Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts