snowymasta Posted August 28, 2020 Share Posted August 28, 2020 Hi Guys, Been trying to make it that when I insert into Mysql at the moment it inserts like dd-mm-yy, however cause I'm in the UK i need it to do it in the UK way of dd-mm-yy I checked out some topics and found the STR_DATE_DATE however I've tried to use it in my mysql but cannot get it to work. Can someone help $query="INSERT INTO job_scheduled (startdate, enddate, job_title, job_reference, job_description, job_postcode, job_city, customername, customer_email, status) VALUES ('".STR_TO_DATE($_SESSION["startdate"],'%d-%m-%y')."', '".$_SESSION["enddate"]."', '".$_SESSION["job_title"]."', '".$_SESSION["job_reference"]."', '".$_SESSION["job_description"]."', '".$_SESSION["job_postcode"]."', '".$_SESSION["job_city"]."', '".$_SESSION["customername"]."', '".$_SESSION["customer_email"]."', 'Provisional')"; Quote Link to comment https://forums.phpfreaks.com/topic/311403-changing-the-date-submited-into-mysql/ Share on other sites More sharing options...
requinix Posted August 28, 2020 Share Posted August 28, 2020 Store it using YYYY-MM-DD. Always. If you want to display it differently then you can display it differently. Quote Link to comment https://forums.phpfreaks.com/topic/311403-changing-the-date-submited-into-mysql/#findComment-1581025 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.