PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
klevis miho
Forum Contributor
Posts: 413 Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:
Post
by klevis miho » Thu Dec 31, 2009 5:18 am
This code:
Code: Select all
<?php
for($i=0; $i<7; $i++) {
//should print today and 6 days after
echo date("o-m-d", mktime() + $i * 86400);
echo '<br />';
}
?>
Prints:
Code: Select all
2009-12-31
2009-01-01
2009-01-02
2009-01-03
2010-01-04
2010-01-05
2010-01-06
Is this a bug?
manojsemwal1
Forum Contributor
Posts: 217 Joined: Mon Jun 29, 2009 4:13 am
Location: India
Post
by manojsemwal1 » Thu Dec 31, 2009 5:46 am
hun if u use 'y' replace of 'o' it would be correct format..
klevis miho
Forum Contributor
Posts: 413 Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:
Post
by klevis miho » Thu Dec 31, 2009 5:49 am
You are right thnx.
I posted this as a bug at php.net :$