File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -49,19 +49,19 @@ extension Date : Value {
4949 }
5050
5151 public static func fromDatatypeValue( _ stringValue: String ) -> Date {
52- return dateFormatter . date ( from: stringValue) !
52+ return sqlDateFormatter . date ( from: stringValue) !
5353 }
5454
5555 public var datatypeValue : String {
56- return dateFormatter . string ( from: self )
56+ return sqlDateFormatter . string ( from: self )
5757 }
5858
5959}
6060
6161/// A global date formatter used to serialize and deserialize `NSDate` objects.
6262/// If multiple date formats are used in an application’s database(s), use a
6363/// custom `Value` type per additional format.
64- public var dateFormatter : DateFormatter = {
64+ public var sqlDateFormatter : DateFormatter = {
6565 let formatter = DateFormatter ( )
6666 formatter. dateFormat = " yyyy-MM-dd'T'HH:mm:ss.SSS "
6767 formatter. locale = Locale ( identifier: " en_US_POSIX " )
Original file line number Diff line number Diff line change @@ -71,19 +71,19 @@ public class DateFunctions {
7171
7272extension Date {
7373 public var date : Expression < Date ? > {
74- return DateFunctions . date ( dateFormatter . string ( from: self ) )
74+ return DateFunctions . date ( sqlDateFormatter . string ( from: self ) )
7575 }
7676
7777 public var time : Expression < Date ? > {
78- return DateFunctions . time ( dateFormatter . string ( from: self ) )
78+ return DateFunctions . time ( sqlDateFormatter . string ( from: self ) )
7979 }
8080
8181 public var datetime : Expression < Date ? > {
82- return DateFunctions . datetime ( dateFormatter . string ( from: self ) )
82+ return DateFunctions . datetime ( sqlDateFormatter . string ( from: self ) )
8383 }
8484
8585 public var julianday : Expression < Date ? > {
86- return DateFunctions . julianday ( dateFormatter . string ( from: self ) )
86+ return DateFunctions . julianday ( sqlDateFormatter . string ( from: self ) )
8787 }
8888}
8989
You can’t perform that action at this time.
0 commit comments