Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. public function compruebaDif(){
  2.  
  3.  
  4. if($this->primer_arhchivo){
  5.  
  6. $this->spreadsheet = PhpOfficePhpSpreadsheetIOFactory::load( "Diciembre 01.xlsx");
  7. $this->celda_fech = $this->spreadsheet->getActiveSheet()->getCell("E5")->getFormattedValue();
  8.  
  9. $dt = new DateTime($this->celda_fech);
  10. $nueva = $dt->format('d/m/Y');
  11.  
  12. $this->subFecha = $nueva;
  13.  
  14. echo $this->subFecha;
  15.  
  16. }elseif (!$this->primer_arhchivo){
  17.  
  18. $this->spreadsheet = PhpOfficePhpSpreadsheetIOFactory::load( "Diciembre 02.xlsx");
  19. $this->celda_fech = $this->spreadsheet->getActiveSheet()->getCell("E5")->getFormattedValue();
  20.  
  21. $dt = new DateTime($this->celda_fech);
  22. $nueva = $dt->format('d/m/Y');
  23.  
  24. $this->fechActual = $nueva;
  25.  
  26. $this->diferencia = $this->fechActual->diff($this->subFecha);
  27.  
  28. echo $this->diferencia;
  29. }
  30.  
  31.  
  32. $this->primer_arhchivo = true;
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement