title: How do I convert from 5 digit number date in PHP?
body: <p>I tried to import an Excel file in the database,but the dates are shown as 5 digit numbers 44605 representing 2/13/2022.What can I use to convert the numbers when trying to import the tables from from the file into the database?The columns for date are data_factura and data_scadenta.</p>
  <pre><code>&lt;?php
  include(&quot;../db/sql/MysqliDb.php&quot;);
  include('../vendor/autoload.php');
  include(&quot;../db_conn.php&quot;);
    
  use PhpOffice\PhpSpreadsheet\Spreadsheet;
  use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
  
    if(isset($_FILES[&quot;filename&quot;]))
  {
    
   $file = $_FILES[&quot;filename&quot;][&quot;tmp_name&quot;];
  
   $file_open = fopen($file,&quot;r&quot;);
  
  $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
  $reader-&gt;setReadDataOnly(TRUE);
  $spreadsheet = $reader-&gt;load($file);
  
  $worksheet = $spreadsheet-&gt;getActiveSheet();
  // Get the highest row and column numbers referenced in the worksheet
  $highestRow = $worksheet-&gt;getHighestRow(); // e.g. 10
  $highestColumn = $worksheet-&gt;getHighestColumn(); // e.g 'F'
  $highestColumnIndex = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::columnIndexFromString($highestColumn); // e.g. 5
  
  
  // for ($row = 1; $row &lt;= $highestRow; ++$row) {
  //     echo '&lt;tr&gt;' . PHP_EOL;
      for ($col = 1; $col &lt;= $highestColumnIndex; ++$col) {
          $value = $worksheet-&gt;getCellByColumnAndRow($col, 1)-&gt;getValue();
          if($value == &quot;Cod client&quot;)
                          $column1 = $col;
          if($value == &quot;Client&quot;)
                          $column2 = $col;
          if($value == &quot;Adresa/sediul social&quot;)
                          $column3 = $col;
          if($value == &quot;Data Factura&quot;)
                          $column4 = $col;
          if($value == &quot;Scadenta&quot;)
                          $column5 = $col;
          if($value == &quot;Total valoare&quot;)
                          $column6 = $col;
          if($value == &quot;Total TVA&quot;)
                          $column7 = $col;
          if($value == &quot;Total factura curenta cu TVA&quot;)
                          $column8 = $col;                                 
      }
   
  // echo $column2;
  
  for ($row = 2; $row &lt;= $highestRow; ++$row) {
     
      $cod_client = $worksheet-&gt;getCellByColumnAndRow($column1, $row)-&gt;getValue();
      $client= $worksheet-&gt;getCellByColumnAndRow($column2, $row)-&gt;getValue();
      $adresa = $worksheet-&gt;getCellByColumnAndRow($column3, $row)-&gt;getValue();
      $data_factura = $worksheet-&gt;getCellByColumnAndRow($column4, $row)-&gt;getValue();
      $data_scadenta = $worksheet-&gt;getCellByColumnAndRow($column5, $row)-&gt;getValue();
      $total_valoare = $worksheet-&gt;getCellByColumnAndRow($column6, $row)-&gt;getValue();
      $total_TVA = $worksheet-&gt;getCellByColumnAndRow($column7, $row)-&gt;getValue();
      $total_factura_curenta = $worksheet-&gt;getCellByColumnAndRow($column8, $row)-&gt;getValue();
  
      // echo $cod_client.', ';
      $adresamodificata= str_replace(&quot;'&quot;, &quot;&quot;,$adresa);
  
  $db-&gt;rawQuery(&quot;INSERT INTO cod_facturi(cod_client,client,adresa,data_factura,data_scadenta,total_valoare,total_TVA,total_factura_curenta) VALUES ('$cod_client','$client','$adresamodificata','$data_factura','$data_scadenta','$total_valoare','$total_TVA','$total_factura_curenta')&quot;);
  
  }
  </code></pre>