Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

SEC_TO_TIME

Example

Convert a specified number of seconds into a corresponding time value.

SELECT SEC_TO_TIME(1);

Definition and Usage

The SEC_TO_TIME() function converts a specified number of seconds into a time value formatted as HH:MM

Syntax

SEC_TO_TIME(seconds)

Parameter Values

Parameter

Description

seconds

Mandatory: Specifies the number of seconds, allowing both positive and negative values.

Technical Details

Works in:

 From MySQL version 4.0

More Examples

Example

Generate a time value based on a specified number of seconds.

SELECT SEC_TO_TIME(-6897);