brmcdani44 Posted May 3, 2013 Share Posted May 3, 2013 I have a table that is being dynamically generated off of a SQL query. I am trying to convert a date to the American version of the date field (m,d,y), however there is an error in my code.Can someone help me out? Any help is appreciated! Thanks in advance! echo "<td>"date('d-m-Y', strtotime(.$row['submit_date'].));"</td>"; Quote Link to comment Share on other sites More sharing options...
davidannis Posted May 3, 2013 Share Posted May 3, 2013 Why do you have periods in strtotime(.$row['submit_date'].)? Quote Link to comment Share on other sites More sharing options...
Solution davidannis Posted May 3, 2013 Solution Share Posted May 3, 2013 Try echo "<td>".date('d-m-Y', strtotime($row['submit_date']))."</td>"; Note: The periods concatenate (combine) the peices of the string being echoed. Quote Link to comment Share on other sites More sharing options...
brmcdani44 Posted May 3, 2013 Author Share Posted May 3, 2013 Sorry I thought I had to have to periods since I was continuing from $row. Thanks for your help Quote Link to comment Share on other sites More sharing options...
Yohanne Posted May 3, 2013 Share Posted May 3, 2013 http://www.php.net/manual/en/datetime.format.php Quote Link to comment 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.