End Date on Details page

2 posts by 1 authors in: Forums > CMS Builder
Last Post: November 6, 2015   (RSS)

By Zicky - November 6, 2015

Got it worked out. Below is the code I used to hide content on the page - based on the current date and time "compared to the" end date and time... just in case someone else finds this useful.

<?php // end_date
$currentDateTime = strtotime(date("Y-m-d H:i:s"));
$theEndDate = strtotime($bidding_opportunitiesRecord['end_date']);

<?php if ($theEndDate > $currentDateTime): ?>

<h1><?php echo htmlspecialchars($bidding_opportunitiesRecord['title']); ?></h1>
<?php echo $bidding_opportunitiesRecord['content']; ?>

<?php else: ?>

<h1>Bidding has ended.</h1>

<?php endif; ?><!-- end_date -->