Created
November 7, 2019 10:03
-
-
Save chrisvasey/239a8a473e3931e7a0b0e38a3f4d947e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dates = null; | |
if ($request->date) { | |
$dates = $request->date; | |
$dates = preg_replace('/\s+/', '', $dates); | |
$dates = explode('-', $dates); | |
$dates = [\DateTime::createFromFormat("d/m/y", $dates[0])->format('Y-m-d')." 00:00:00",\DateTime::createFromFormat("d/m/y", $dates[1])->format('Y-m-d')." 00:00:00"]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment