I have datetime information stored in the format YYYY-mm-ddTHH:MM:SS in accordance with ISO8601 format. However I want to grab information from my SQLite database if the stored date is later than current datetime.
Here is an example of what I'm trying to implement:
SELECT * FROM mydb WHERE date > datetime('now')
The problem is that the SQLite function datetime('now') returns the date in the same format as the above but without the 'T' literal and so renders the stored datetime value which is in ISO8601 format uncomparable to datetime('now').
Is there any way that I can make this comparison without changing the database values?
Aucun commentaire:
Enregistrer un commentaire