Last active
August 29, 2015 14:15
-
-
Save hayakawatomoaki/c94a44991538a5793b0f to your computer and use it in GitHub Desktop.
Swiftで現在からの経過時間を計算するNSDateのExtension ref: http://qiita.com/hayakawatomoaki/items/8f1d5aeb74ba2156245c
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
var c = "2015-02-06 19:48:31".toDate(format: "yyyy-M-d HH:mm:ss")?.stringForTimeIntervalSinceCreated() // optional | |
println(c) // Optional("5 days") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment