Reference start date and end date for date field 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 &gt;= $date1 &amp;&amp; $now &lt;= $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 &amp; $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?
If that is a node field, then the values you are trying to use are accessible using the following code.

$items = field_get_items('node', $node, 'field_time');

$from = $items[0]['value'];
$to = $items[0]['value2'];