php date plus days
<?php
// PHP program to add days to $Date
// Declare a date
$date = "2019-05-10";
// Add days to date and display it
echo date('Y-m-d', strtotime($date. ' + 10 days'));
?>
php date plus days
<?php
// PHP program to add days to $Date
// Declare a date
$date = "2019-05-10";
// Add days to date and display it
echo date('Y-m-d', strtotime($date. ' + 10 days'));
?>
function return time ago php
public function convert_time_to_days($date) {
$current_date = date("Y-m-d H:m:s");
$time = array();
$day = floor((strtotime($current_date) - strtotime($date)) / (60 * 60 * 24));
if ($day == 0) {
$hour = floor((strtotime($current_date) - strtotime($date)) / (60 * 60));
if ($hour == 0) {
$minute = floor((strtotime($current_date) - strtotime($date)) / (60));
$time = $minute . __d('course', "minutes ago");
} else {
$time = $hour . __d('course', "hours ago");
}
} else {
$time = $day . __d('course', "days ago");
}
return $time;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us