rwahdan Posted March 19, 2009 Share Posted March 19, 2009 hi, i am trying to convert an input field that is used by date picker then convert the date from d-m-Y to Y-m-d so that i can check mysql database and get results but i am getting wrong dates! i found the problem and i dont know why it is doing this!!!!!! $thestartdate = $_POST['startdate']; $thestartdate1 = date("Y-m-d", strtotime($thestartdate)); $theenddate=$_POST['enddate']; $theenddate1 = date("Y-m-d", strtotime($theenddate)); echo "$thestartdate1 $theenddate1"; echo '<br>'; echo "$thestartdate $theenddate"; the first result is wrong! the second is ok!!!!!! why is that!!!!! check: http://tamouh-salesoffice.com/tamouh/reportsgenerator.php Quote Link to comment https://forums.phpfreaks.com/topic/150100-date-is-wrong/ Share on other sites More sharing options...
Renlok Posted March 19, 2009 Share Posted March 19, 2009 idk we cant actually view the page Quote Link to comment https://forums.phpfreaks.com/topic/150100-date-is-wrong/#findComment-788457 Share on other sites More sharing options...
Maq Posted March 19, 2009 Share Posted March 19, 2009 Can you give us an example of what dates are being submitted? Your code looks fine. Quote Link to comment https://forums.phpfreaks.com/topic/150100-date-is-wrong/#findComment-788459 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.