     var pickerNSDate :NSDate?
     var timerAlert : NSDate?
     var t : Task?
-    
+    var total :Double?
     
     
     override func viewDidLoad() {

    }
    
    @IBAction func alarmAction(sender: AnyObject) {
        // 1
        let notification = UILocalNotification()
        // 15
        print(timerAlert)
        notification.fireDate = fixedNotificationDate(timerAlert!)
        // 3
        notification.alertBody = "Tarea pendiente de revision"
        // 4
        notification.timeZone = NSTimeZone.defaultTimeZone()
        // 5
        //notification.repeatInterval = NSCalendarUnit.Minute
        // 6
        notification.applicationIconBadgeNumber = 1
        // 7
        UIApplication.sharedApplication().scheduleLocalNotification(notification)
    }
    
    func fixedNotificationDate(dateToFix: NSDate) -> NSDate {
        
        let dateComponents: NSDateComponents = NSCalendar.currentCalendar().components([NSCalendarUnit.Day, NSCalendarUnit.Month, NSCalendarUnit.Year, NSCalendarUnit.Hour, NSCalendarUnit.Minute], fromDate: dateToFix)
        
        dateComponents.second = 0
        
        let fixedDate: NSDate = NSCalendar.currentCalendar().dateFromComponents(dateComponents)!
        

        }
        
        
        let timeIntervalCountDown = total! - timeInterval
        let timeAlert = total! + timeInterval
        let timerDate:NSDate = NSDate(timeIntervalSince1970: timeIntervalCountDown);
        print(timerDate)
        
        timerAlert = NSDate(timeIntervalSinceNow: total!)

        // Create a date formatter
        let dateFormatter = NSDateFormatter();
        dateFormatter.dateFormat = "HH:mm:ss";
        dateFormatter.timeZone = NSTimeZone(forSecondsFromGMT: 0);
        
        // Format the elapsed time and set it to the label
