i.e.
// getting the current time in an array
$timeval=localtime();

// we want the time 3 hours in the future
$timeval[2] = $timeval[2]+3;

// calc the new timestamp
$timestamp=mktime ($timeval[2], $timeval[1], $timeval[0], $timeval[4], $timeval[3], 
i$timeval[5]);

########################

An even better solution, you are talking about a unix-timestamp, right?

just add or subtract the the seconds from the current timestamp,
i.e.

// get the current timestamp
$timestamp=time();

// 1 minute = 60 seconds, 1 hour = 60 minutes, therefore 1 hour = 60*60 = 3600 seconds
// so we add 3600*3 to have the time in 3 hours
$timestamp = $timestamp + (3600*3);

// you can convert this time back to a readable format using strftime

############

Regards,

Thomas

On Sun, 11 Jan 2004 16:22:08 +0330 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:

> 
> So Thanks, but can you get me some example code?
> 
> Regards,
> Sadeq
> 
> "Thomas Seifert" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > http://de.php.net/manual/en/function.mktime.php
> >
> > The most important part is
> > "mktime() is useful for doing date arithmetic and validation, as it will
> automatically calculate the correct value for out-of-range input."
> >
> >
> >
> > Thomas
> >
> > On Sun, 11 Jan 2004 16:12:01 +0330 [EMAIL PROTECTED] (Sadeq Naqashzade) wrote:
> >
> > > 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 :-(
> > >
> > >
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to