Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
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);