#NEWLINE# def datestring_to_epoch( datestring ) : #NEWLINE# #INDENT# d = datestring #NEWLINE# if ( not isinstance ( d , datetime ) ) : #NEWLINE# #INDENT# d = datetime . strptime ( datestring , dateformat ) #NEWLINE# #UNINDENT# epoch = int ( ( d - datetime ( 1970 , 1 , 1 ) ) . total_seconds ( ) ) #NEWLINE# return epoch