SQL PHP HTML ASP JavaScript articles and free scripts to download
PHP Date


We can assign new date to any date object by using setDate function. Using this we can change the date object.
setDate(Year, month, day)
Here are some examples to set the date.
$today = new DateTime;
echo $today->format('Y-m-d ');
echo "<br>";
echo $today->format('Y-m-d');
The output is here
IN above code we can change the setDate function parameters and check the output. We can change to higher values for year and month , the function will adjust it to the next values and display the correct dates. Here are the changes ( only )
The output is here

Number of User Comments : 1

Click for more tutorial on Date & Time functions and Applications

More On Date Object
hgggfhhfhf ghf26-08-2014
how to display this (Fri May 14 12:03:24 IST
Post Comment This is for short comments only. Use the forum for more discussions.
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2015 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer