bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL SUBTIME() Function

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind MySQL SUBTIME() Function?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___ SUBTIME("2017-06-15 10:24:21.000004", "5.000001");
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The SUBTIME() function subtracts time from a time/datetime expression and then returns the new time/datetime.
Definition and Usage
MySQL SUBTIME() Function

Example

SELECT SUBTIME("2017-06-15 10:24:21.000004", "5.000001");

Definition and Usage

The SUBTIME() function subtracts time from a time/datetime expression and then returns the new time/datetime.

Syntax

SUBTIME(
datetime
,
time_interval
)

Parameter Values

ParameterDescription
datetimeRequired. The time or datetime to be modified
time_intervalRequired. The time interval to subtract from datetime . Both positive and negative values are allowed

Technical Details

Works in:From MySQL 4.0

Previous

MySQL SUBDATE() Function

Next

MySQL SYSDATE() Function