Subtracts a time value (expr2) from a datetime or time expression (expr1).
TIME/DATETIMEDiperbarui: 13 Jun 2026SUBTIME(expr1, expr2)The starting time or datetime value
The time value to subtract (format: 'HH:MM:SS')
1 SELECT SUBTIME('10:00:00', '02:30:00') AS result;
Subtracts 2 hours and 30 minutes.
1 SELECT SUBTIME('2024-01-15 10:00:00', '05:30:00') AS result;
Subtracts a time value from a datetime.
1 SELECT event_name, 2 end_time, 3 SUBTIME(end_time, duration) AS start_time 4 FROM events;
Calculates the start time by subtracting the duration from the end time.
Sudah paham SUBTIME? Latih langsung di browser
Latihan interaktif, langsung di browser.