def get_filterdate(filter_date, date_time):
 returnvalue = ''
 date_year = strftime('%Y', gmtime(date_time))
 date_month = strftime('%m', gmtime(date_time))
 date_day = strftime('%d', gmtime(date_time))
 if ((filter_date == 'today') and (int(date_year) == int(localtime()[0])) and (int(date_month) == int(localtime()[1])) and (int(date_day) == int(localtime()[2]))):
  returnvalue = 'true'
 elif ((filter_date == 'thismonth') and (date_time >= (time() - 2592000))):
  returnvalue = 'true'
 elif ((filter_date == 'thisyear') and (int(date_year) == int(localtime()[0]))):
  returnvalue = 'true'
 elif ((filter_date == 'past7days') and (date_time >= (time() - 604800))):
  returnvalue = 'true'
 elif (filter_date == ''):
  returnvalue = 'true'
 return returnvalue

def get_filterdate ( filter_date , date_time ) : returnvalue = '' date_year = strftime ( '%Y' , gmtime ( date_time ) ) date_month = strftime ( '%m' , gmtime ( date_time ) ) date_day = strftime ( '%d' , gmtime ( date_time ) ) if ( ( filter_date == 'today' ) and ( int ( date_year ) == int ( localtime ( ) [ 0 ] ) ) and ( int ( date_month ) == int ( localtime ( ) [ 1 ] ) ) and ( int ( date_day ) == int ( localtime ( ) [ 2 ] ) ) ) : returnvalue = 'true' elif ( ( filter_date == 'thismonth' ) and ( date_time >= ( time ( ) - 2592000 ) ) ) : returnvalue = 'true' elif ( ( filter_date == 'thisyear' ) and ( int ( date_year ) == int ( localtime ( ) [ 0 ] ) ) ) : returnvalue = 'true' elif ( ( filter_date == 'past7days' ) and ( date_time >= ( time ( ) - 604800 ) ) ) : returnvalue = 'true' elif ( filter_date == '' ) : returnvalue = 'true' return returnvalue
get filterdate .