Jump to content

PHP Date Format Help


kamal213

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.