I'm trying show some text when it falls between a certain date, but I am having trouble referencing the start date and end date of the date field.
My code is:
$now = time();
$date1 = strtotime($date1);
$date2 = strtotime($date2);
if ( $now >= $date1 && $now <= $date2) {
echo 'This is a new video';
} else {
echo 'This is an OLD video';
}
But it is not working because I do not think I am getting the value of the date in $date1 & $date2. My drupal field (named field_time) is set up as a Date (UNIX timestamp). I used the Devel Module to see where the start and end dates are held and it told me "date1" and "date2".
But my code above isn't referencing the field, so im suspicious. Am I referencing the correct date strings above?
$node->field_time
.