get 2 days before date in php
date('Y/m/d',strtotime("-1 days"));
Or Use DateTime class like this-
$date = new DateTime();
echo $date->modify("-1 days")->format('Y-m-d');
get 2 days before date in php
date('Y/m/d',strtotime("-1 days"));
Or Use DateTime class like this-
$date = new DateTime();
echo $date->modify("-1 days")->format('Y-m-d');
php count days excluding weekends
function sumDays($days = 0, $format = 'd/m/Y') {
$incrementing = $days > 0;
$days = abs($days);
$actualDate = date('Y-m-d');
while ($days > 0) {
$tsDate = strtotime($actualDate . ' ' . ($incrementing ? '+' : '-') . ' 1 days');
$actualDate = date('Y-m-d', $tsDate);
if (date('N', $tsDate) < 6) {
$days--;
}
}
return date($format, strtotime($actualDate));
}
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