devxlogo

Using MICROSECOND in MySQL

Using MICROSECOND in MySQL

By default, developers work with time up to the level of seconds, i.e. HOURS, MINUTES and SECONDS. There could be instances in which we may want to work on the MICROSECOND level as well.

The example below illustrates the usage of MICROSECOND in TIME.

Query:

SELECT MICROSECOND(NOW(3));

Note: NOW takes an argument between 0 to 6 and the precision of the value is based on this argument.

Sample output:

+---------------------+| MICROSECOND(NOW(3)) |+---------------------+|              176000 |+---------------------+
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist