I'm trying to get the date from the date-time-picker name="dob" into the php but it only post 2017 in the database user_age column. However, if I assigned $dob manually to $dob = '10/09/1988' it works.
<div class="form-group date-time-picker label-floating is-empty">
<label class="control-label">Birthday</label>
<input name="datetimepicker">
</div>
And here is the php
<?php
$dob = $_GET['datetimepicker'];
$dob = explode("/", $dob);
$agv = (date("md", date("U", mktime(0, 0, 0, $dob[0], $dob[1], $dob[2]))) >
date("md") ? ((date("Y") - $dob[2]) -1) : (date("Y") - $dob[2]));
$age = mysqli_real_escape_string($conn, $agv);
?>