Views Contextual Filter by Day and Night I have a content type with a boolean field, using radio buttons for day and night.

I would like to create a view with a contextual filter, which shows "day content" between 8:00 am - 8:00 pm and "night content" between 8:00 pm and 8:00 am.

Which is the best way for creating the contextual filter or view?

Or if you'd have a better suggestion, I could change my content type and fields too.
your approach is correct.

You can do one thing..Just create a view and contextual filter in view for radio field.
use hook_views_pre_view() hook to add arguments.

function MODULE_NAME_views_pre_view(&amp;$view, &amp;$display_id, &amp;$args) {
  if ($view-&gt;name == 'myview' &amp;&amp; $display_id == 'page_1') {
    $current_time = date('H'); //24hrs format
    if ($current_time &gt;= 8 &amp;&amp; $current_time &lt;= 20) {
      $args[] = "value of day radio button";
    }
    else {
      $args[] = "value of night radio button";
    }
  }
}


Hope this will help