kamal213 Posted September 16, 2011 Share Posted September 16, 2011 Hi guys I have this date script below which displays like so: 16/09/2011. Its fine but I now like it to display like this: 16 September 2011 Please I need help in twicking the code to do this Thanks! <?php //check to see if passing variable is set i.e. if true get day, month, year. if(isset($_GET['day'])){ $day = $_GET['day']; } else{ //Get today's date and put them in date, month, year $day = date("d"); } if(isset($_GET['month'])){ $month = $_GET['month']; } else{ $month = date("m"); } if(isset($_GET['year'])){ $year = $_GET['year']; } else{ $year = date("Y"); } echo $day."/".$month."/".$year; ?> Quote Link to comment Share on other sites More sharing options...
WebStyles Posted September 16, 2011 Share Posted September 16, 2011 check out the date function on php.net. all the options are there and nice ly explained. basically the format you want is something like: date("d l Y"); Quote Link to comment Share on other sites More sharing options...
kamal213 Posted September 16, 2011 Author Share Posted September 16, 2011 Hi WebStyles thanks for getting back I'll give it a try now Quote Link to comment Share on other sites More sharing options...
kamal213 Posted September 16, 2011 Author Share Posted September 16, 2011 It comes up like: 16 Friday 2011 But need it to come out in 16 September 2011 Quote Link to comment Share on other sites More sharing options...
kamal213 Posted September 16, 2011 Author Share Posted September 16, 2011 It works now! Changed date("d l Y"); to date("d F Y"); from the manual like you pointed out Problems Solved Thanks!!! Quote Link to comment Share on other sites More sharing options...
WebStyles Posted September 16, 2011 Share Posted September 16, 2011 opps, sorry, did it from memory without checking the manual. let this be a lesson to me Quote Link to comment Share on other sites More sharing options...
kamal213 Posted September 16, 2011 Author Share Posted September 16, 2011 lol haha yessir! the manual is really handy lots of other date formats as well. Thanks for pointing it out to me 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.