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.
Prob with date formate in mysql
Moderator: General Moderators
-
GaneshPrasad
- Forum Newbie
- Posts: 5
- Joined: Thu Mar 22, 2012 12:50 am
Re: Prob with date formate in mysql
Default format for DATETIME is YYYY-MM-DD. What is the column type in your table?
-
eoin.ahern@mycit.ie
- Forum Newbie
- Posts: 15
- Joined: Mon Mar 05, 2012 11:48 am
Re: Prob with date formate in mysql
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');
i used $datetime =date('Y-m-d H:i:s');
-
eoin.ahern@mycit.ie
- Forum Newbie
- Posts: 15
- Joined: Mon Mar 05, 2012 11:48 am
Re: Prob with date formate in mysql
or you could try date('d/m/y H:i:s'); not sure if that would work though.
-
eoin.ahern@mycit.ie
- Forum Newbie
- Posts: 15
- Joined: Mon Mar 05, 2012 11:48 am
Re: Prob with date formate in mysql
but it probably will! 
-
GaneshPrasad
- Forum Newbie
- Posts: 5
- Joined: Thu Mar 22, 2012 12:50 am
Re: Prob with date formate in mysql
column datatype is Date