Created
July 16, 2017 08:00
-
-
Save Sydney-o9/69db4c6dad4d7c5dff4cf74db9245984 to your computer and use it in GitHub Desktop.
SWIFT: Create Json string from Date
This file contains hidden or 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
let dateFormatter = DateFormatter() | |
let enUSPosixLocale = Locale(identifier: "en_US_POSIX") | |
dateFormatter.locale = enUSPosixLocale | |
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" | |
let createdDate = dateFormatter.string(from: Date()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment