Answers for "create date time with two dates php"

PHP
2

php get date between two dates

$period = new DatePeriod(
     new DateTime('2010-10-01'),
     new DateInterval('P1D'),
     new DateTime('2010-10-05')
);

//Which should get you an array with DateTime objects. 

//To iterate

foreach ($period as $key => $value) {
    //$value->format('Y-m-d')       
}
Posted by: Guest on August-22-2020
0

combine date time php

$start_y = 2020;
$start_m = 11;
$start_d = 23;

$date = $start_y . "-" . str_pad($start_m, 2, "0", STR_PAD_LEFT) . "-" . str_pad($start_d, 2, "0", STR_PAD_LEFT);
Posted by: Guest on November-23-2020

Code answers related to "create date time with two dates php"

Browse Popular Code Answers by Language