JSHINER Posted April 10, 2007 Share Posted April 10, 2007 You must enter it as 2007-04-31 - on the form. Link to comment https://forums.phpfreaks.com/topic/46467-dates/page/2/#findComment-226200 Share on other sites More sharing options...
papaface Posted April 10, 2007 Author Share Posted April 10, 2007 I dont want to. Thats not how we do dates here in the UK. Link to comment https://forums.phpfreaks.com/topic/46467-dates/page/2/#findComment-226201 Share on other sites More sharing options...
per1os Posted April 10, 2007 Share Posted April 10, 2007 The date/time field in MySQL can be formatted a certain way. Do you have the createtable statement. Because if you want it in that format you will need to alter the table to reflect that format this way you can enter the dates into the DB the way you want. Without that you have to convert them the same as the database is. Databases are picky when it comes to dates. Link to comment https://forums.phpfreaks.com/topic/46467-dates/page/2/#findComment-226202 Share on other sites More sharing options...
JSHINER Posted April 10, 2007 Share Posted April 10, 2007 Here's something you can take a look at about converting date formats: http://www.phpfreaks.com/forums/index.php/topic,127739.0.html It's a tricky thing, and yes, databases are VERY picky about dates - either they're perfect, or do not get entered at all. Link to comment https://forums.phpfreaks.com/topic/46467-dates/page/2/#findComment-226206 Share on other sites More sharing options...
papaface Posted April 10, 2007 Author Share Posted April 10, 2007 Okay thanks. I'm just going to make them enter it in the way the DB likes. I cba to mess around with it. Thanks for all your help Link to comment https://forums.phpfreaks.com/topic/46467-dates/page/2/#findComment-226207 Share on other sites More sharing options...
JSHINER Posted April 10, 2007 Share Posted April 10, 2007 Yes good idea - make the database happy and you will be happy. Just put below the form field (Ex: 31-04-2007) so they know how to enter it. Good luck! Link to comment https://forums.phpfreaks.com/topic/46467-dates/page/2/#findComment-226208 Share on other sites More sharing options...
JSHINER Posted April 10, 2007 Share Posted April 10, 2007 Also - go ahead and hit that SOLVED button at the bottom. Link to comment https://forums.phpfreaks.com/topic/46467-dates/page/2/#findComment-226213 Share on other sites More sharing options...
per1os Posted April 10, 2007 Share Posted April 10, 2007 Really if you are not planning on viewing the raw data like via phpmyadmin all the time I would insert dates as an INT(11) and just enter the UNIX timestamp into the DB, that way you can easily manipulate the date anyway you want to. Link to comment https://forums.phpfreaks.com/topic/46467-dates/page/2/#findComment-226215 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.