title: How to compare last modified time of a file in ansible
body: <p>I have a file with last modified time shown as "1563886751.38" (with stat and mtime). I wanted to check if the time is same when I run the playbook.</p>
  
  <p>I have defined a variable as file_time: 1563872351.
  I wanted to check if this value is present in the mtime.</p>
  
  <pre><code>vars: 
  file_date: 1563872351
  
  - name: test
      stat:
       path: /tmp/logrotate/testx1
      register: sym
  
  - debug:
     msg: "{{same}}"
    when: sym.stat.mtime.find(file_date) != -1
  </code></pre>
  
  <p>But I get the below error:</p>
  
  <pre><code>'dict object' has no attribute 'find'
  </code></pre>
  
  <p>I see there is not attribute find but is there some way to do this? I need to check if it contains the value, not equal to.</p>