title: Trying to create timeAgo function for news feed, but it just displays "0 seconds ago"
body: <p>I am trying to create a newsfeed that shows something like "3 minutes ago" or whatever the current time is from when they posted. However, very time I post to the newsfeed it just says 0 seconds ago. Could someone please tell me where my code is messing up.</p>
  
  <pre><code>func timeAgoDisplay() -&gt; String {
  
          let secondsAgo = Int(Date().timeIntervalSinceNow)
  
          if secondsAgo &lt; 60 {
              return "\(secondsAgo) seconds ago"
          } else if secondsAgo &lt; 60 * 60 {
              return "\(secondsAgo / 60) minutes ago"
          } else if secondsAgo &lt; 60 * 60 * 24 {
              return "\(secondsAgo / 60 / 60) hours ago"
          }
  
          return "\(secondsAgo / 60 / 60 / 24) days ago"
      }
  </code></pre>