ubuntu Posted May 15, 2007 Share Posted May 15, 2007 Dear all, Please help me if you know how to get today's date using php. Below is the coding, what's wrong with this? Thank you for your kind attention. Regards. <?php $today = date("D M d Y"); echo "<font size=1>$today</font>\n"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/51438-solved-get-todays-date-function-in-php/ Share on other sites More sharing options...
radar Posted May 15, 2007 Share Posted May 15, 2007 Here is how you need to do it... If you are going to do something like that you would need to come up with a timestamp... So try this code out... <?php $date = time(); $today = date("D M d Y", $date); echo "<font size=1>'$today'</font>\n"; ?> With the date function you also need to pass in a timestamp. The time stamp is created when I called the time() function... Try that out and it should work perfectly for you. Quote Link to comment https://forums.phpfreaks.com/topic/51438-solved-get-todays-date-function-in-php/#findComment-253313 Share on other sites More sharing options...
ubuntu Posted May 15, 2007 Author Share Posted May 15, 2007 Thanks bro, it worded. Quote Link to comment https://forums.phpfreaks.com/topic/51438-solved-get-todays-date-function-in-php/#findComment-253332 Share on other sites More sharing options...
radar Posted May 15, 2007 Share Posted May 15, 2007 Don't mention it, happy to help out. Quote Link to comment https://forums.phpfreaks.com/topic/51438-solved-get-todays-date-function-in-php/#findComment-253346 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.