<?php // assuming | is meant to be a space like this: function dates_range($todaynow) { $date1 = strtotime("2011-11-01"); $date2 = strtotime("2012-12-31"); if (($todaynow >= $date1) and ($todaynow <= $date2)) { # do something } } // I would write: function betweenDates($dateInQuestion, $afterDate, $beforeDate) { $after = strtotime($afterDate); $before = strtotime($beforeDate); $now = strtotime($dateInQuestion); return $after <= $now && $now <= $before; } // in your code you can then write if (betweenDates('now', '2011-11-01', '2012-12-31')) { # do something } On 20 October 2013 15:44, John Taylor-Johnston <jt.johnston@xxxxxxxxxxxxxx>wrote: > |function dates_range($todaynow) > { | > |$date1=strtotime("2011-11-01"**); > $date2=strtotime("2012-12-31")**; > if (|||($|||||todaynow |>= $date1) and |||||($|||||||todaynow| <= > $date2)||) > || { > || # do something > |||| } > } > ||| > Tim-Hinnerk Heuer Twitter: @geekdenz Blog: http://www.thheuer.com