We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
Countdown based on date and time fieldtype?
I'm trying to 'jazz up' a list of tenders by showing how many days left there is to submit a bid. Is there a format function that already exists in Perch that will allow me to easily specify a countdown to a date and time defined by the user using
perch:content type="date" time="true"?
Essentially, this sort of function:
<?php $date = strtotime("March 7, 2016 2:00 PM"); $remaining = $date - time(); $days_remaining = floor($remaining / 86400); $hours_remaining = floor(($remaining % 86400) / 3600); echo "$days_remaining days $hours_remaining hours left"; ?>
Want to reply to this thread?Login with Perch