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


By using a date object we can set time to any value by using setTime property this format

setTime( Hour, minutes, seconds )

All above inputs are in integer.
Here are some examples.
$date = new DateTime('2012-04-15 22:15:40');
echo $date->format('Y/m/d H:i:s') . "<br>";
echo $date->format('Y/m/d H:i:s') . "<br>";

The output is here
2012/04/15 22:15:40
2012/04/15 23:30:00
We can change the setTime to different values and output will change like this .
output is here
2012/04/15 22:15:40
2012/04/15 02:50:32

Be the first to post comment on this article :

Click for more tutorial on Date & Time functions and Applications

More On Date Object
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