Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php string to date convertion and dates between

        $date = explode(' - ',$request['expected_date']);
        $start_date = date('Y-m-d', strtotime($date[0]));
        $end_date = date('Y-m-d', strtotime($date[1]));

        $dates = array();
        $current = strtotime($start_date);
        $date2 = strtotime($end_date);
        $stepVal = '+1 day';
        while( $current <= $date2 ) {
           $dates[] = date('Y-m-d', $current);
           $current = strtotime($stepVal, $current);
        }
Source by www.quora.com #
 
PREVIOUS NEXT
Tagged: #php #string #date #convertion #dates
ADD COMMENT
Topic
Name
8+6 =