I am using sqlite database in my application in which I am storing a Date and Time in milli-seconds. Now using Sqlite query I am trying to get this datetime from milliseconds to date in format "yyyy-MM-dd" but not getting a proper result.
I want to do this using a Sqlite query. Your help will be appreciated.
Datetime
expects epochtime, which is in number of seconds while you are passing in milliseconds. Convert to seconds & apply.
SELECT datetime(1346142933585/1000, 'unixepoch');
Can verify this from this fiddle
Try:
select strftime("%Y-%m-%d", YOUR_DATE_COL) from .......
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With