Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/10/2015, 07:48
Avatar de hhs
hhs
Colaborador
 
Fecha de Ingreso: junio-2013
Ubicación: México
Mensajes: 2.995
Antigüedad: 11 años, 8 meses
Puntos: 379
Respuesta: convertir string a date

No es necesario que conviertas la fecha nuevamente a string.
Código PHP:
Ver original
  1. date_default_timezone_set('America/Monterrey');
  2.  
  3.  
  4. try {
  5.  
  6.     $date = new DateTime('22-10-2015');
  7.     $date->modify('+5 day');
  8.     echo $date->format('Y-m-d');
  9.  
  10. } catch (Exception $e) {
  11.     echo $e->getMessage();
  12. }
__________________
Saludos
About me
Laraveles
A class should have only one reason to change.