Re: Change Date
From: Kim Steinhaug (kim_at_steinhaug.com)
Date: 11/25/03
- Next message: Richard Cyganiak: "Re: Detecting Server API (CGI or Apache) at runtime?"
- Previous message: Kim Steinhaug: "Re: [PHP] Passing vars w/refresh w/register globals off?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: php-general@lists.php.net Date: Tue, 25 Nov 2003 20:21:37 +0100
Is it me or are everyone responding how to give a the date in here?
The timestamp is still time() and not date() isnt it?
Timestamp works in seconds, so 1 hour is : 60 seconds * 60 minutes.
$hour = 60*60;
$day = 24*$hour;
timestamp for 125 days into the future would then be,
$futuretimestamp = time() + ($day*125);
time() returns the current timestamp, this very second. All you do is
calculate
all the seconds there is in 125 days and add it up. If you want to go back
to
the future, you subtract it from time().
Then, when you want the date to be entered for the screen or somthing use
the date() command.
-- Kim Steinhaug --------------------------------------------------------------- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. --------------------------------------------------------------- "Sadeq Naqashzade" <ss@yazd.info> wrote in message news:20030111124320.21735.qmail@pb1.pair.com... > Hi, > How can I find time stamp for example 125 next days. or 03:30 hours next? > > Regards, > S. Naqashzade > PS: Sorry for my bad english :-( > >
- Next message: Richard Cyganiak: "Re: Detecting Server API (CGI or Apache) at runtime?"
- Previous message: Kim Steinhaug: "Re: [PHP] Passing vars w/refresh w/register globals off?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]