Created
August 1, 2019 01:01
-
-
Save Haeuncs/97745dc043f386d533bedacae31dec35 to your computer and use it in GitHub Desktop.
Swift String to Date format
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 UIKit | |
var str = "Hello, playground" | |
var date = "20190801" | |
let formatter = DateFormatter() | |
formatter.dateFormat = "yyyyMMdd" | |
formatter.date(from: date) | |
formatter.string(from: Date()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment