0 Replies
      Latest reply on Feb 5, 2020 1:41 PM by wlionel
      wlionel Level 1 Level 1 (0 points)

        in my code line 6 is returning the save date but

        line 7 is printing the current date

        I want the save date instead for attribute "date" (line 6)

         

        func getFormattedDate(date: Date, format: String) -> String {
                        let dateformat = DateFormatter()
                        dateformat.dateFormat = format
                        return dateformat.string(from: date)
                }
        _ = item.value(forKey: "date") as? NSDate
        let formatingDate = getFormattedDate(date: Date(), format: "dd-MMM-yyyy")