My code:
let dateFormatter = DateFormatter()
dateFormatter.timeStyle = .short
dateFormatter.dateStyle = .short
dateFormatter.locale = .current
lblDateTime.text = dateFormatter.string(from: date)
The problem is I need dateFormatter.dateStyle = .none for today date. How to resolve it correctly? Is it possible to avoid manual date calculations to determine "today date"?
You can check if the given date is in today,
Calendarprovides an appropriate APIIf you can live with a four digit year and non-padded day and month, this is an alternative