I used Bootstrap datepicker to get date from the user. I stored that value in database. But when i render this date in html, it showed unexpected value with the date !
I give the screen shot of the result.
Can anyone help me to solve this ?
I used Bootstrap datepicker to get date from the user. I stored that value in database. But when i render this date in html, it showed unexpected value with the date !
I give the screen shot of the result.
Can anyone help me to solve this ?
How have you stored the date in the database?
Make sure you used DATETIME and not VARCHAR
Also how did you get the date from the database?
I would use:
$query = "SELECT DATE_FORMAT(ColumnName, '%Y-%m-%d %H:%i:%s') AS Date FROM Table";
$result = mysqli_query($cxn,$query) or die(mysqli_error());
$date = $result->fetch_object()->Date;