Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $date1 = $_REQUEST['date_1'];
- $date2 = $_REQUEST['date_2'];
- //Remove the "/"s in the date, as this confuses the function which creates the DateTime object
- $date1 = str_replace("/", "-",$date1);
- $date2 = str_replace("/", "-",$date2);
- // convert these date strings to the DateTime object for manipulation
- $date1 = date_create($date1);
- $date2 = date_create($date2);
- // Convert these DateTime objects to show the date in a differnt format as a string
- $date1 = date_format($date1, "Y-m-d");
- $date2 = date_format($date2, "Y-m-d");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement