$values = []; $cellData = new Google_Service_Sheets_CellData(); $value = new Google_Service_Sheets_ExtendedValue(); $value->setStringValue($aDateS->format("dmY")); // $aDateS -> DateTime object $cellData->setUserEnteredValue($value); $values[] = $cellData; $rowData = new Google_Service_Sheets_RowData(); $rowData->setValues($values); $rows[] = $rowData; 

Next, I create a query:

 $appendRequest->setSheetId($aSheetId); $appendRequest->setRows($rowAr); $appendRequest->setFields("userEnteredValue"); $request = new Google_Service_Sheets_Request(); $request->setAppendCells($appendRequest); $requests = [$request]; $batchUpdateRequest = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest(["requests" => $requests]); 

And I send it, it is successfully sent, but before the date itself, for some reason, it inserts a 'quote Problem screen

Other values ​​are normally inserted.

    1 answer 1

    Remove end of line quote

     rtrim($date, "'"); 

    Remove the quote from the beginning of the string

     ltrim($date, "'"); 
    • In this case, the problem is that the request itself is transmitted without a 'quotation mark, Google is already wise about something, or I don’t understand something. Looked under the sniffer request passes without this quotation mark - Corporal
    • In MSSQL, the format of such a value in the format of the N'значение is transmitted for transmitting Cyrillic. Do you have all the string values ​​added? - Evgeny Nikolaev