Skip to content

Question: Filter by date. #962

Open
Open
@Samback

Description

@Samback

Hi there,
I just wanna filter all dates that older than 24 hours.
I was trying to do it like this https://github.com/stephencelis/SQLite.swift/blob/master/Documentation/Index.md#date-time-values
But it doesn't work for me :(

E.g:

let table = self.table
let boundDate = Date(timeInterval: -86400, since: Date())
let query = table.filter(self.date <= boundDate )
print(query.asSQL())

As a result I get zero items.
My SQL query logs print next

SELECT * FROM "logs" WHERE ("date" <= '2019-10-15T18:54:18.109')

What I'm doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions