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; ?> Link to comment https://forums.phpfreaks.com/topic/247258-php-date-format-help/ 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"); Link to comment https://forums.phpfreaks.com/topic/247258-php-date-format-help/#findComment-1269829 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 Link to comment https://forums.phpfreaks.com/topic/247258-php-date-format-help/#findComment-1269838 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 Link to comment https://forums.phpfreaks.com/topic/247258-php-date-format-help/#findComment-1269840 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!!! Link to comment https://forums.phpfreaks.com/topic/247258-php-date-format-help/#findComment-1269842 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 Link to comment https://forums.phpfreaks.com/topic/247258-php-date-format-help/#findComment-1269843 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 Link to comment https://forums.phpfreaks.com/topic/247258-php-date-format-help/#findComment-1269852 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.