DatabaseDateComponents
public struct DatabaseDateComponents : DatabaseValueConvertible, StatementColumnConvertible, Codable
                DatabaseDateComponents reads and stores DateComponents in the database.
- 
                  
                  
The available formats for reading and storing date components.
See moreDeclaration
Swift
public enum Format : String 
- 
                  
                  
The date components
Declaration
Swift
public let dateComponents: DateComponents - 
                  
                  
The database format
Declaration
Swift
public let format: Format - 
                  
                  
Creates a DatabaseDateComponents from a DateComponents and a format.
Declaration
Swift
public init(_ dateComponents: DateComponents, format: Format)Parameters
dateComponentsAn optional DateComponents.
formatThe format used for storing the date components in the database.
 
- 
                  
                  
Returns a value initialized from a raw SQLite statement pointer.
Declaration
Swift
@inline(__always) @inlinable public init?(sqliteStatement: SQLiteStatement, index: Int32)Parameters
sqliteStatementA pointer to an SQLite statement.
indexThe column index.
 
- 
                  
                  
Returns a value that can be stored in the database.
Declaration
Swift
public var databaseValue: DatabaseValue { get } - 
                  
                  
Returns a DatabaseDateComponents if dbValue contains a valid date.
Declaration
Swift
public static func fromDatabaseValue(_ dbValue: DatabaseValue) -> DatabaseDateComponents? 
- 
                  
                  
Creates a new instance by decoding from the given decoder.
Declaration
Swift
public init(from decoder: Decoder) throwsParameters
decoderThe decoder to read data from.
 - 
                  
                  
Encodes this value into the given encoder.
Declaration
Swift
public func encode(to encoder: Encoder) throwsParameters
encoderThe encoder to write data to.
 
View on GitHub
Install in Dash
        DatabaseDateComponents Structure Reference