Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $today = new DateTime();
- $alert_date = new DateTime($alerts[$i]['due']);
- $interval = $today->diff($alert_date);
- if($interval->d > 0) {
- $deadline = $interval->format('%d') . ' days';
- } elseif($interval->m > 0) {
- $deadline = $interval->format('%m') . ' months';
- } elseif($interval->y > 0) {
- $years = $interval->format('%y') . ' years';
- }
Add Comment
Please, Sign In to add comment