Created
March 2, 2018 16:22
-
-
Save backslash-f/f6cd94bffc78911e8de9c5f8599426e8 to your computer and use it in GitHub Desktop.
Is it today? (Calendar, Date, DateFormatter, Swift)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let dateFormatter = DateFormatter() | |
dateFormatter.dateFormat = "YYYY-MM-dd'T'HH:mm:ssZZZZZ" | |
let date = dateFormatter.date(from: "2018-03-02T10:00:00-0800") | |
Calendar.current.isDateInToday(date!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment