 }
 
 
-
-
 /// An ISO-8601 date-time structure, the common JSON format for dates and times
 /// - See: https://en.wikipedia.org/wiki/ISO_8601
-public struct BricDateTime: Hashable, Equatable, CustomStringConvertible, Bricable, Bracable, Breqable {
+public protocol ISO8601DateTime {
+    var year: Int { get set }
+    var month: Int { get set }
+    var day: Int { get set }
+    var hour: Int { get set }
+    var minute: Int { get set }
+    var second: Double { get set }
+    var zone: (hours: Int, minutes: Int) { get set }
+}
+
+
+public struct BricDateTime: ISO8601DateTime, Hashable, Equatable, CustomStringConvertible, Bricable, Bracable, Breqable {
     public typealias BricDate = (year: Int, month: Int, day: Int)
     public typealias BricTime = (hour: Int, minute: Int, second: Double)
     public typealias BricZone = (hours: Int, minutes: Int)
 
-    public let year, month, day, hour, minute: Int
-    public let second: Double
-    public let zone: BricZone
+    public var year, month, day, hour, minute: Int
+    public var second: Double
+    public var zone: BricZone
 
     public init(year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Double, zone: BricZone) {
         self.year = year

        func sec(secs: Double) -> String {
            var str = String(secs)
            let chars = str.characters
            if chars.count >= 2 && chars.dropFirst().first == "." { str = "0" + str }
            while str.characters.count < 6 { str += "0" }
            return str
        }

        return pad(year, 4) + "-" + pad(month, 2) + "-" + pad(day, 2) + "T" + pad(hour, 2) + ":" + pad(minute, 2) + ":" + sec(second) + (zone.hours == 0 && zone.minutes == 0 ? "Z" : ((zone.hours >= 0 ? "+" : "") + pad(zone.hours, 2) + ":" + pad(zone.minutes, 2)))
    }


    /// Attempt to parse the given String as an ISO-8601 date-time structure
    public init?(_ str: String) {
        var gen = str.characters.generate()

        func scan(skip: Int = 0, _ until: Character...) -> (String, Character?)? {


        if gen.next() != nil { return nil } // trailing characters

        // fill in the fields
        var dtm = self
        dtm.year = year
        dtm.month = month
        dtm.day = day
        dtm.hour = hour
        dtm.minute = minute
        dtm.second = second
        dtm.zone = (tzh, tzm)
        return dtm
    }
}
