#NEWLINE# def get_filterdate( filterDate , dateTime ) : #NEWLINE# #INDENT# '\n    Get filterdate.\n    ' #NEWLINE# returnvalue = '' #NEWLINE# dateYear = strftime ( '%Y' , gmtime ( dateTime ) ) #NEWLINE# dateMonth = strftime ( '%m' , gmtime ( dateTime ) ) #NEWLINE# dateDay = strftime ( '%d' , gmtime ( dateTime ) ) #NEWLINE# if ( filterDate == ( 'today' and ( int ( dateYear ) == int ( localtime ( ) [ 0 ] ) ) and ( int ( dateMonth ) == int ( localtime ( ) [ 1 ] ) ) and ( int ( dateDay ) == int ( localtime ( ) [ 2 ] ) ) ) ) : #NEWLINE# #INDENT# returnvalue = 'true' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( filterDate == 'thismonth' ) and ( dateTime >= ( time ( ) - 2592000 ) ) ) : #NEWLINE# #INDENT# returnvalue = 'true' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( filterDate == 'thisyear' ) and ( int ( dateYear ) == int ( localtime ( ) [ 0 ] ) ) ) : #NEWLINE# #INDENT# returnvalue = 'true' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( filterDate == 'past7days' ) and ( dateTime >= ( time ( ) - 604800 ) ) ) : #NEWLINE# #INDENT# returnvalue = 'true' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( filterDate == '' ) : #NEWLINE# #INDENT# returnvalue = 'true' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return returnvalue