Žan Anđić
asked on
Input date format yyyy-mm-dd
Hi,
I have little problem with date picker in html input field.
When I choose date from picker it show in this format: dd.mm.yyyy but when that record save to database MySQL shows like this:
yyyy-mm-dd , what is the best way to make this working, to write in database date in this format dd.mm.yyyy
there is html:
EDIT:
I am fix that using date("d.m.Y",strtotime($_P OST['datum _rodjenja' ]));
I have little problem with date picker in html input field.
When I choose date from picker it show in this format: dd.mm.yyyy but when that record save to database MySQL shows like this:
yyyy-mm-dd , what is the best way to make this working, to write in database date in this format dd.mm.yyyy
there is html:
<label>Date of birth:</label>
<input type="date" class="form-control" name="date_birth" required />
EDIT:
I am fix that using date("d.m.Y",strtotime($_P
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I changed to DATE, and when showing i put
$database_date = // set db date here
$display_date = date('d.m.Y', strtotime($database_date));
Is there a question in your last post?
ASKER
Changed to DATE, displaying like I wrote on my previous commentar
Thank you Julian and Ryan
Thank you Julian and Ryan
You are welcome.
ASKER
Thank you for answer,
I am storing dates in a varchar field. I have date picker, and in date picker date is showed well. And I replace just this:
$date_of_birth=$_POST['dat
with this:
$date_of_birth=("d.m.Y",st