Welcome Guest, Not a member yet? Register   Sign In
date problem
#1

[eluser]Bigil Michael[/eluser]
i want to add tome to dates
my code is like this
Code:
$checkin_date = $this->input->post('checkin_date');
$checkout_date = $this->input->post('checkout_date');
$checkin_hour = $this->input->post('checkin_hour');
$checkin_minute = $this->input->post('checkin_minute');
$checkout_hour = $this->input->post('checkout_hour');
$checkout_minute = $this->input->post('checkout_minute');

echo  $f_date = date("Y-m-d H:i:s ", strtotime($checkin_date));
                            $newtime = strtotime($f_date . ' + '.$checkin_hour.' hours'.' + '.$checkin_minute.' minutes'.' + '.$ss.' seconds').'<br/>';
                        echo    $firstdate = date('Y-m-d H:i:s', $newtime).'<br/>';

echo $la_date = date("Y-m-d H:i:s ", strtotime($checkout_date)).'<br/>';
                    $newtime2 = strtotime($la_date . ' + '.$checkout_hour.' hours'.' + '.$checkout_minute.' minutes'.' + '.$ss.' seconds').'<br/>';
                    echo $lastdate = date('Y-m-d H:i:s', $newtime2).'<br/>';
problem is that in first case print the correct result
echo last date print wrong result like this
1970-00-00 :00:00:00

i dont know what is the problem can anyone help me?????
#2

[eluser]Bigil Michael[/eluser]
sorry for this post
i solved my problem.
problem is in this step
echo $la_date = date("Y-m-d H:iConfused ", strtotime($checkout_date)).'<br/>';




Theme © iAndrew 2016 - Forum software by © MyBB