Clinton Posted April 16, 2008 Share Posted April 16, 2008 I've got this code: <input type="text" name="dob" value="<? echo $row{'dob'}; ?>">> It pulls out the data just fine but it displays it Y-m-d. How can I get it to display m/d/Y ? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/101404-solved-easy-date-format-question/ Share on other sites More sharing options...
rhodesa Posted April 16, 2008 Share Posted April 16, 2008 <input type="text" name="dob" value="<? echo date('n/j/Y',strtotime($row{'dob'})); ?>">> refer to http://us.php.net/date for more on the format switches Quote Link to comment https://forums.phpfreaks.com/topic/101404-solved-easy-date-format-question/#findComment-518625 Share on other sites More sharing options...
Clinton Posted April 16, 2008 Author Share Posted April 16, 2008 strtotime... that's right. Thanks a lot! Quote Link to comment https://forums.phpfreaks.com/topic/101404-solved-easy-date-format-question/#findComment-518630 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.