We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b070343 commit 8bf721eCopy full SHA for 8bf721e
ruby-china-ios/Extensions/String+Ext.swift
@@ -0,0 +1,21 @@
1
+//
2
+// String+Ext.swift
3
+// ruby-china-ios
4
5
+// Created by 柯磊 on 16/10/9.
6
+// Copyright © 2016年 ruby-china. All rights reserved.
7
8
+
9
+import Foundation
10
11
+extension String {
12
+ func dateValue(format: String) -> NSDate? {
13
+ let dateFormatter = NSDateFormatter()
14
+ dateFormatter.dateFormat = format
15
+ return dateFormatter.dateFromString(self)
16
+ }
17
18
+ func dateValueFromISO8601() -> NSDate? {
19
+ return self.dateValue("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
20
21
+}
0 commit comments