Sunday, 25 August 2013

how to convert int into time period

how to convert int into time period

i have today date and i want to reduce hours\days from it. i get the
"hours to reduce interval" in int that indicat number of days.
i try something like this:
$today_date = date('Y-m-d H:i:s');
$temp_interval_date = $settings->days_back;
$interval_date = date('H',$temp_interval_date*24);
$final = $temp_interval_date - $interval_date;
my final goal is to get todaydate - interval period in this format
'Y-m-d H:i:s'
i am c# dude :)
thanks

No comments:

Post a Comment