Skip to content
Advertisement

How to add minutes to datetime?

I want to add minutes that already exist in same table. I have a datetime and a duration. I want to get the start date/time as well as the end date/time.

I can use datetime but have to specify ‘localtime’ which doesn’t work. I want the equivalent of DATEADD in SQL Server.

Advertisement

Answer

Try

datetime(strftime('%s', start_date) + minute_count * 60,  'unixepoch')

start_date – your start date;

minute_count – count of minutes as integer.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement