To get sqlite to parse a date string, including 'now', you have to use date() or datetime(). There is no automatic conversion.
sqlite is very particular about dates. This will work
date('1963-11-23')
but this won't
date('1963/11/23')
Also NB that datetime('10:21:00') will not default to today's date, but to Jan 1 2000.
And further NB that to subtract (etc) dates you must use julianday() to convert them to numeric values. Your difference will thus be in fractional days.
Incidentally they are proper Julian Day numbers which is handy for astronomy.
So let's be clear, datetime() converts a string to a standard format datetime representation string. It is these strings that are stored in datetime type fields.
Conversely, julianday() converts these strings into serial date numbers (specifically Julian Day numbers).
Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.
Quick
- ($a, $b....) = unpack("A2A7...", $packed)
- push( array, list )