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
KeeganWolf
Forum Newbie
Posts: 19 Joined: Thu May 14, 2009 3:13 pm
Post
by KeeganWolf » Tue Aug 18, 2009 11:31 am
Hi,
I'm trying to use mktime to return tomorrows date. I read something at one point that this might be a php bug.
Code: Select all
$tomorrow = mktime(0,0,0,date("m"),date("d")+1,date("Y"));
echo $tomorrow;
Returns the output...
1250665200
Why would this be?
Zoxive
Forum Regular
Posts: 974 Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan
Post
by Zoxive » Tue Aug 18, 2009 1:27 pm
I don't see the problem here.
php.net wrote:
mktime() returns the
Unix timestamp of the arguments given.
Darhazer
DevNet Resident
Posts: 1011 Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria
Post
by Darhazer » Tue Aug 18, 2009 4:03 pm
Pass the result of mktime to date():
Code: Select all
$tomorrow = date('Y-m-d', mktime(0,0,0,date("m"),date("d")+1,date("Y")));