Get Records 30 minutes before date and time

2021-08-23T20:29:19

Been trying to get this to work for 2 days and this is frustrating me.

Trying to get records 30 minutes before a date/time (Format in database is datetime).

This is what I have:

select id 
from tbl_events 
WHERE DATE_SUB(NOW(), INTERVAL -30 MINUTE) = DATE_FORMAT(start, '%Y-%m-%d %H:%i:%s')

What the heck am I missing?

Thanks

Copyright License:
Author:「Will W」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/68892747/get-records-30-minutes-before-date-and-time

About “Get Records 30 minutes before date and time” questions

Been trying to get this to work for 2 days and this is frustrating me. Trying to get records 30 minutes before a date/time (Format in database is datetime). This is what I have: select id from
I need a registration button to disappear 30 minutes before a meeting starts. My meeting date is stored in one field and the start time is in another field. The conditional code for the date is wor...
I have two data frames in csv files. First data described traffic incidents (df1) and second data has the traffic record data for each 15 minutes(df2). I want to merge between them based on the clo...
I have date and time stored separately in different column in a table. So I'm trying to check if the current time is 30 minutes early or late from the time in the database. Let's say I have a list...
I have a MySQL query, the target is to get all profile IDs from a table that contains profiles in which user's last activity 30 minutes or more, or there was no activity recorded from that user at ...
I have a column (lastlogin) that contains the following value = '17th May 2017 09:40:43 AM' ---- php function to create stamp: date('jS F Y h:i:s A'); How can I do a select query that shows the (
I am trying to query some records and am looking to return only records that have a date of today, but also are before the current time. I have the first part sorted out by using the following cla...
Having a nightmare at the moment and just can't see why it isn't working I have a value in the form H:i (ie 10:00, 13:30) etc called $time What I want to do is create two new values, $startTime w...
I am working on a project in which I have to split all date in array. so I get the time in hours and minutes variable. Time is like '2015-11-07E05:02:50.631Z'. var res = ev_time.split("E"); var t=...
i have mm-dd-YYYY H:i Date format, and i want to add 30 minutes in selected Date Time. function SetEndDate(start_date){ // start_date = "05-25-2017 05:00" var duration = '30'; ...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.