         guard parseCount >= 6 else { return DatabaseDateComponents(components, format: .YMD_HM) }
 
         components.second = Int(second.pointee)
-        components.nanosecond = Int((second.pointee - Float(components.second!)) * 1_000_000_000)
+
+        guard parseCount >= 7 else { return DatabaseDateComponents(components, format: .YMD_HMS) }
+
+        components.nanosecond = Int(nanosecond.pointee)
 
         return DatabaseDateComponents(components, format: .YMD_HMSS)
     }

        pthread_mutex_lock(&mutex)
        defer { pthread_mutex_unlock(&mutex) }

        let parseCount = withVaList([year, month, day, hour, minute, second]) { pointer in
            vsscanf(dateString, "%d-%d-%d%*c%d:%d:%f", pointer)
        }

        guard parseCount >= 3 else { return nil }

        var components = DateComponents()

        components.year = Int(year.pointee)
        components.month = Int(month.pointee)
        components.day = Int(day.pointee)

        pthread_mutex_lock(&mutex)
        defer { pthread_mutex_unlock(&mutex) }

        let parseCount = withVaList([hour, minute, second, nanosecond]) { pointer in
            vsscanf(timeString, "%d:%d:%d.%d", pointer)
        }

        guard parseCount >= 2 else { return nil }

        var components = DateComponents()
        components.hour = Int(hour.pointee)
        components.minute = Int(minute.pointee)

        guard parseCount >= 3 else { return DatabaseDateComponents(components, format: .HM) }

        components.second = Int(second.pointee)

        guard parseCount >= 4 else { return DatabaseDateComponents(components, format: .HMS) }

        components.nanosecond = Int(nanosecond.pointee)

        return DatabaseDateComponents(components, format: .HMSS)
    }
}
