hi i am new to php.
i want to display week days from current date.
it means that if it is today 2008-09-29 then
i want to display as
2008-09-29
2008-09-30
2008-10-01
2008-10-02
2008-10-03
2008-10-04
2008-10-05
Please help me.
Thanks in advance.
increase current date by one
Moderator: General Moderators
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: increase current date by one
PHP Tip #5534
Don't use formatted dates...dealing with a simple timestamp is always easier and faster for the computer.
60 seconds in a minute
60 minutes in a hour
60 * 60 = 3600 seconds in a hour
Because timestamps are essentially the number of seconds sinced UNIX epoch (or whatever it's called) you can calculate the timestamp for tomorrow by doing something like:
Don't use formatted dates...dealing with a simple timestamp is always easier and faster for the computer.
60 seconds in a minute
60 minutes in a hour
60 * 60 = 3600 seconds in a hour
Because timestamps are essentially the number of seconds sinced UNIX epoch (or whatever it's called) you can calculate the timestamp for tomorrow by doing something like:
Code: Select all
$tomorrow = time() + ((60 * 60) + 24)