I'm calculating a countdown to a date. XXX Days Left. I'd like to show the hundreds place as zero if the total days left is less than 100.
This is where I'm at so far:
$now = time();
$your_date = strtotime(get_field('first_day'));
$datediff = abs($now - $your_date);
echo floor($datediff/(60*60*24));
Based on the target date, the output is 72. I'd like it to show 072.
Can someone help me with this?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.