entity – "EntityMetadataWrapperException: Invalid data value specified. Make sure that it matches the required data type and format for the date field."

I'm working on creating a calendar event, so I've created a custom event storage module for a custom content type. I installed the entity and date modules and created a date field (partner_event_date) that accepts values ​​from and up to the date.

In my custom module I use the following code.

$wrapper->field_partner_event_date->set(array(
  'value' => date('Y-m-d H:i:s',$dateFrom),
  'value2' => date('Y-m-d H:i:s', $dateTo),
));

The following output is displayed at the top of the screen.

array(
  'value' => '2022-02-05 00:00:00',
  'value2' => '2024-07-03 00:00:00',
)

The error I get is the following.

EntityMetadataWrapperException: Invalid data value specified. Make sure it matches the required data type and format. Value at node () -> field_partner_event_date:. in EntityMetadataWrapper-> set () (line 122 of /sites/all/modules/entity/includes/entity.wrapper.inc).

I installed my module on a new Drupal installation. It works fine while the client site (which has already been created) displays this error message during installation and configuration. Can anyone help?

entity – EntityMetadataWrapperException: Invalid data value specified. Make sure it matches the required data type and format for the date field in Drupal 7

I'm working on creating a calendar event, so I've created a custom event storage module for a custom content type. I have already installed the entity module and the date module.
I have a date field & # 39; partner_event_date & # 39; created that accepts dates from and to.

In my custom module, I wrap the date field values ​​as follows:

$ wrapper-> field_partner_event_date-> set (array (
& # 39; value & # 39; => Date (& # 39; Y-m-d H: i: s & # 39 ;, $ dateFrom),
& # 39; value2 & # 39; => Date (& # 39; Y-m-d H: i: s & # 39 ;, $ dateTo),
));

And an output is shown at the top of the screen:
Array (& # 39; Value & # 39; => & # 39; 2022-02-05 00: 00: 00 & # 39 ;, & # 39; Value2 & # 39; => & # 39; 2024-07-03 00 : 00: 00 & # 39 ;,)

The error I get is:
EntityMetadataWrapperException: Invalid data value specified. Make sure it matches the required data type and format. Value at node () -> field_partner_event_date:. in EntityMetadataWrapper-> set () (line 122 of /sites/all/modules/entity/includes/entity.wrapper.inc).

I installed my module on a new Drupal installation, it works perfectly there, but on the client site (which was already created) when I installed and configured it, these errors are displayed. Can somebody help me with it.

Python error opening an XLS file. "Unsupported format or corrupt file: Expected BOF record; found b & # 39; T & # 39;"

I am trying to open large amounts of data from an XLS file (very old file).

When I try to open it with Excel, I get this error
Introduction to the description of the image aquí
PDTA: The data is too large so I couldn't open it with Excel … (opening the file takes more than 1 day.)

I tried many forms to open it with Python (Jupyter Notebook) and nothing worked. These are the codes I used.

import pyexcel
sheet0 = pyexcel.get_sheet(file_name="1_62_Q145147.SALok4.xls", name_columns_by_row=0)

def open_xls_as_xlsx(filename):
# first open using xlrd
book = xlrd.open_workbook(filename)
index = 0
nrows, ncols = 0, 0
while nrows * ncols == 0:
sheet = book.sheet_by_index(index)
nrows = sheet.nrows+1 #bm added +1
ncols = sheet.ncols+1 #bm added +1
index += 1
# prepare a xlsx sheet
book1 = Workbook()
sheet1 = book1.get_active_sheet()
for row in range(1, nrows):
for col in range(1, ncols):
sheet1.cell(row=row, column=col).value = sheet.cell_value(row-1, col-1) #bm added -1's
return book1

The error is this in most cases.

"Unsupported format, or corrupt file: Expected BOF record; found b'