zgkhoo Posted October 7, 2007 Share Posted October 7, 2007 how to change mysql default date format to ddmmyyyy or dd-mm-yyyy? where user only need enter ddmmyyyy or dd-mm-yyyy in the form <input type=text> thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/72164-solved-change-date-format/ Share on other sites More sharing options...
Barand Posted October 7, 2007 Share Posted October 7, 2007 MySQL default format of yyyy-mm-dd is that for a reason. It's ISO standard and you can do comparisons/sorts with that format. dd-mm-yyyy is totally useless as a db date format. Quote Link to comment https://forums.phpfreaks.com/topic/72164-solved-change-date-format/#findComment-363994 Share on other sites More sharing options...
zgkhoo Posted October 7, 2007 Author Share Posted October 7, 2007 but in my country the default is dd-mm-yyyy then how i gonna to do ...if i wanna let user key in dd-mm-yyyy in <input type=text> field? thanks. Quote Link to comment https://forums.phpfreaks.com/topic/72164-solved-change-date-format/#findComment-364011 Share on other sites More sharing options...
fenway Posted October 7, 2007 Share Posted October 7, 2007 but in my country the default is dd-mm-yyyy then how i gonna to do ...if i wanna let user key in dd-mm-yyyy in <input type=text> field? thanks. Use a date picker and format the string internally... if you must keep it that way, use the STR_TO_DATE() mysql function and specify a format string. Quote Link to comment https://forums.phpfreaks.com/topic/72164-solved-change-date-format/#findComment-364036 Share on other sites More sharing options...
zgkhoo Posted October 8, 2007 Author Share Posted October 8, 2007 what is date picker? Quote Link to comment https://forums.phpfreaks.com/topic/72164-solved-change-date-format/#findComment-364569 Share on other sites More sharing options...
fenway Posted October 9, 2007 Share Posted October 9, 2007 A fancy HTML widget that displays calendar-looking things and translates this into an sql-ready date for you. Quote Link to comment https://forums.phpfreaks.com/topic/72164-solved-change-date-format/#findComment-365099 Share on other sites More sharing options...
zgkhoo Posted October 9, 2007 Author Share Posted October 9, 2007 ok, got it, thanks you very much.. Quote Link to comment https://forums.phpfreaks.com/topic/72164-solved-change-date-format/#findComment-365135 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.