bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL SEC_TO_TIME() Function

Concept visual

MySQL SEC_TO_TIME() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Return a time value based on a specified seconds value:

SELECT SEC_TO_TIME(1);

Definition and Usage

The SEC_TO_TIME() function returns a time value (in format HH:MM:SS) based on the specified seconds.

Syntax

SEC_TO_TIME( seconds )

Parameter Values

Parameter

Description seconds

Required. The number of seconds. Both positive or negative values are allowed

Technical Details

Works in:

From MySQL 4.0

More Examples

Example

Return a time value based on a specified seconds value:

SELECT SEC_TO_TIME(-6897);

Previous

❮ MySQL Functions

Next

Previous

MySQL SECOND() Function

Next

MySQL STR_TO_DATE() Function