File tree 2 files changed +7
-7
lines changed 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -49,19 +49,19 @@ extension Date : Value {
49
49
}
50
50
51
51
public static func fromDatatypeValue( _ stringValue: String ) -> Date {
52
- return dateFormatter . date ( from: stringValue) !
52
+ return sqlDateFormatter . date ( from: stringValue) !
53
53
}
54
54
55
55
public var datatypeValue : String {
56
- return dateFormatter . string ( from: self )
56
+ return sqlDateFormatter . string ( from: self )
57
57
}
58
58
59
59
}
60
60
61
61
/// A global date formatter used to serialize and deserialize `NSDate` objects.
62
62
/// If multiple date formats are used in an application’s database(s), use a
63
63
/// custom `Value` type per additional format.
64
- public var dateFormatter : DateFormatter = {
64
+ public var sqlDateFormatter : DateFormatter = {
65
65
let formatter = DateFormatter ( )
66
66
formatter. dateFormat = " yyyy-MM-dd'T'HH:mm:ss.SSS "
67
67
formatter. locale = Locale ( identifier: " en_US_POSIX " )
Original file line number Diff line number Diff line change @@ -71,19 +71,19 @@ public class DateFunctions {
71
71
72
72
extension Date {
73
73
public var date : Expression < Date ? > {
74
- return DateFunctions . date ( dateFormatter . string ( from: self ) )
74
+ return DateFunctions . date ( sqlDateFormatter . string ( from: self ) )
75
75
}
76
76
77
77
public var time : Expression < Date ? > {
78
- return DateFunctions . time ( dateFormatter . string ( from: self ) )
78
+ return DateFunctions . time ( sqlDateFormatter . string ( from: self ) )
79
79
}
80
80
81
81
public var datetime : Expression < Date ? > {
82
- return DateFunctions . datetime ( dateFormatter . string ( from: self ) )
82
+ return DateFunctions . datetime ( sqlDateFormatter . string ( from: self ) )
83
83
}
84
84
85
85
public var julianday : Expression < Date ? > {
86
- return DateFunctions . julianday ( dateFormatter . string ( from: self ) )
86
+ return DateFunctions . julianday ( sqlDateFormatter . string ( from: self ) )
87
87
}
88
88
}
89
89
You can’t perform that action at this time.
0 commit comments