I'm looking at doing some basic date/time manipulation using SQLite however the documentation isn't very clear. All I want to do is add some minutes that already exist in the same row in the database. I have a datetime, and then a duration. So I want to get the start date/time as well as the end date/time. I've looked at something along these lines:
I see you can use datetime, but you have to specify a 'localtime' which doesn't seem to work.
Basically, I want the equivalent of DATEADD in SQL Server.
This is how you add 15 minutes to the current datetime
.
SELECT datetime('now', '+15 Minute');
Try
datetime(strftime('%s', start_date) + minute_count * 60, 'unixepoch')
start_date
– your start date;
minute_count
– count of minutes as integer.
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