--- loncom/interface/lonsearchcat.pm 2017/08/11 00:32:07 1.353 +++ loncom/interface/lonsearchcat.pm 2020/08/26 00:42:39 1.354 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.353 2017/08/11 00:32:07 raeburn Exp $ +# $Id: lonsearchcat.pm,v 1.354 2020/08/26 00:42:39 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1883,6 +1883,8 @@ sub build_date_queries { my (undef,undef,undef,$cbday,$cbmon,$cbyear) = localtime($cbefore); # Correct for year being relative to 1900 $cayear+=1900; $cbyear+=1900; + # Correct month; localtime gives month 0..11 but MySQL expects 1..12 + $camon++; $cbmon++; my $cquery= '(creationdate BETWEEN '. "'".$cayear.'-'.$camon.'-'.$caday."'". @@ -1901,6 +1903,8 @@ sub build_date_queries { my (undef,undef,undef,$mbday,$mbmon,$mbyear) = localtime($mbefore); # Correct for year being relative to 1900 $mayear+=1900; $mbyear+=1900; + # Correct month; localtime gives month 0..11 but MySQL expects 1..12 + $mamon++; $mbmon++; my $mquery= '(lastrevisiondate BETWEEN '. "'".$mayear.'-'.$mamon.'-'.$maday."'".