title: Cannot assign a value of type 'NSDate' to a value of type 'String?'
body: <p>I am teaching myself swift and I am still very new but I decided to make a simple app that prints the current time when you press a button. the code from the viewcontroller file is as follows:</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
      override func viewDidLoad() {
          super.viewDidLoad()
      }
      @IBOutlet weak var LblTime: UILabel!
      @IBAction func BtnCalltime(sender: AnyObject) {
              var time = NSDate()
              var formatter = NSDateFormatter()
              formatter.dateFormat = "dd-MM"
              var formatteddate = formatter.stringFromDate(time)
              LblTime.text = time
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
      }
  }
  </code></pre>
  
  <p>I am having an issue with the line:</p>
  
  <pre><code>LblTime.text = time
  </code></pre>
  
  <p>I keep getting the error:</p>
  
  <blockquote>
    <p>Cannot assign a value of type 'NSDate' to a value of type 'String?'</p>
  </blockquote>
  
  <p>I have tried using:</p>
  
  <pre><code>lblTime.text = time as! string?
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>lblTime.text = time as! string
  </code></pre>
  
  <p>but it does still not work, I would be very appreciative of some help.
  Thanks</p>