title: Difference between the past date time and current time in minutes in golang
body: <p>I have current time and past time, Im trying to findout difference in minutes.</p>
  
  <p>Here is my code im trying, although im new to go.</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "time"
  )
  
  func main() {
      //fetching current time
      currentTime := time.Now().Format("2006-01-02 15:04:05")
      //past time comes in as string
      pasttimestr := "2018-10-10 23:00"
      layout := "2006-01-02 15:04:05"
      //converting string to date
      pasttime, err := time.Parse(layout, pasttimestr)
          if err != nil {
          fmt.Println(err)
      }
      //differnce between pastdate and current date
      diff := currentTime.Sub(pasttime)
      fmt.Println("difference time in min : ", diff)
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code># command-line-arguments
  .\dates.go:21:21: currentTime.Sub undefined (type string has no field or method Sub)
  </code></pre>
  
  <p>Thanks in advance :)</p>