In my variable
$time=2008-12-19 14:12:10 this value is in database
and
duration to find next date is 21157 in seconds
$event_length=21157

Suppose today's date is 2008-12-21
How to find next date by using $time value??

$timestamp = strtotime("$time");
$etime = strtotime("+$event_length seconds", $timestamp);

$next_time = date('Y:m:d H:i:s', $etime); //here date get's today's date

So my problem is How to find next time and date??

in your example, You have already converted your date to a timestamp and have the event length in seconds, so just add the seconds to the timestamp. Here, Try This...

$timestamp = strtotime("$time");
$etime = $timestamp+$event_length;
$next_time = date('Y:m:d H:i:s', $etime); //here date get's today's date

Hope It Helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.