Wednesday, August 5, 2015

add hours, days, weeks, months to any date in magento

      $date = date("Y-m-d");

      $mydate = strtotime(date("Y-m-d", strtotime($date)) . " +3hours");

      $mydate = strtotime(date("Y-m-d", strtotime($date)) . " +1 day");

      $mydate = strtotime(date("Y-m-d", strtotime($date)) . " +1 week");

      $mydate = strtotime(date("Y-m-d", strtotime($date)) . " +30 days");

      $mydate = strtotime(date("Y-m-d", strtotime($date)) . " +1 month");

1 comment:

  1. You should mainly superior together with well-performing material, which means that see it: 900 seconds into minutes

    ReplyDelete

Fatal error: Class Zend\Stdlib\Parameters contains 1 abstract method... magento 2

Fatal error: Class Zend\Stdlib\Parameters contains 1 abstract method and must therefore be declared abstract or implement the remaining met...