format_time

The format_time function converts a time value in picoseconds into a human-readable string with appropriate units (e.g., ms, s, min).

Sys Schema is available from MariaDB 10.6.

Syntax

sys.format_time(picoseconds)

Description

format_time is a stored function available with the Sys Schema. Given a time in picoseconds, returns a human-readable time value and unit indicator. Unit can be:

  • ps - picoseconds

  • ns - nanoseconds

  • us - microseconds

  • ms - milliseconds

  • s - seconds

  • m - minutes

  • h - hours

  • d - days

  • w - weeks

This function is very similar to the FORMAT_PICO_TIME function introduced in MariaDB 11.0.2, but with the following differences:

  • Represents minutes as m rather than min.

  • Represent weeks.

Examples

This page is licensed: CC BY-SA / Gnu FDL

Last updated

Was this helpful?