Page 1 of 1
Prob with date formate in mysql
Posted: Sat Mar 24, 2012 4:53 am
by GaneshPrasad
Hi sir good afternoon,
In the mysql default date formate is ("yy/mm/dd") but I want to insert date formate like ("dd/mm/yy") if there is any alternative pls help me
Even I tried using str_to_date() function but it is displaying mysql default formate.
Re: Prob with date formate in mysql
Posted: Sat Mar 24, 2012 5:20 am
by Celauran
Default format for DATETIME is YYYY-MM-DD. What is the column type in your table?
Re: Prob with date formate in mysql
Posted: Sat Mar 24, 2012 8:47 am
by eoin.ahern@mycit.ie
yes i had to create a date time column in a table yesterday and this worked for me as Celauran stated above default format for datetime is YYYY-MM-DD. so
i used $datetime =date('Y-m-d H:i:s');
Re: Prob with date formate in mysql
Posted: Sat Mar 24, 2012 8:49 am
by eoin.ahern@mycit.ie
or you could try date('d/m/y H:i:s'); not sure if that would work though.
Re: Prob with date formate in mysql
Posted: Sat Mar 24, 2012 8:52 am
by eoin.ahern@mycit.ie
but it probably will!

Re: Prob with date formate in mysql
Posted: Mon Mar 26, 2012 2:01 am
by GaneshPrasad
column datatype is Date