P
P
Pavel Sidorov2021-09-09 16:29:46
1C-Bitrix
Pavel Sidorov, 2021-09-09 16:29:46

How to add the end of the Bitrix api element activity?

I add an element through the Bitrix api. Tell me how to add an activity end date +10 from the current date the item was added?

do

$arLoadProductArray = Array( 
  .....
          "ACTIVE_TO" => date('d.m.Y H:i:s', strtotime('+10 day')),
.....
        ); 
        if($newElement = $el->Add($arLoadProductArray))  
        echo "+"; 
        else 
        echo "Error: ".$el->LAST_ERROR;


the error writes

Error: Invalid format for the end date of the activity.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Sidorov, 2021-09-09
@pavel__sidorov

figured out

"DATE_ACTIVE_TO" => ConvertTimeStamp(time()+(86400 * 10), "FULL"),
          "DATE_ACTIVE_FROM" => ConvertTimeStamp(time(), "FULL"),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question