there is a timepair table. It has columns :
start_pair end_pair
08:30:00 09:15:00
I need to shift it by 30 min - how to do it? 8:30 becomes 9:00.
update
set start_pair = date(start_pair) + minute(30)
there is a timepair table. It has columns :
start_pair end_pair
08:30:00 09:15:00
I need to shift it by 30 min - how to do it? 8:30 becomes 9:00.
update
set start_pair = date(start_pair) + minute(30)
I suppose you can use the DATE_ADD() function :
SET start_pair = DATE_ADD(start_pair, INTERVAL 30 MINUTE)
see https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_time-to-sec add 30 minutes(in seconds) and https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_sec-to-time
for example
set @t = '08:30:00';
select @t, sec_to_time(time_to_sec(@t) + (30*60));
+----------+----------------------------------------+
| @t | sec_to_time(time_to_sec(@t) + (30*60)) |
+----------+----------------------------------------+
| 08:30:00 | 09:00:00 |
+----------+----------------------------------------+
1 row in set (0.00 sec)