Skip to content

Instantly share code, notes, and snippets.

@chrisvasey
Created November 7, 2019 10:03
Show Gist options
  • Save chrisvasey/239a8a473e3931e7a0b0e38a3f4d947e to your computer and use it in GitHub Desktop.
Save chrisvasey/239a8a473e3931e7a0b0e38a3f4d947e to your computer and use it in GitHub Desktop.
<?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