bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL TIME_TO_SEC() Function

Concept visual

MySQL TIME_TO_SEC() Function

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

Start at both ends

Example

Convert a time value into seconds: SELECT TIME_TO_SEC("19:30:10");

Definition and Usage

The TIME_TO_SEC() function converts a time value into seconds.

Syntax

TIME_TO_SEC( time )

Parameter Values

Parameter

Description time

Required. The time value

Technical Details

Works in:

From MySQL 4.0

More Examples

Example

Convert a time value into seconds: SELECT TIME_TO_SEC("00:00:05");

Example

Convert a time value into seconds: SELECT TIME_TO_SEC("03:30:00.999999");

Example

Convert a time value into seconds: SELECT TIME_TO_SEC("-03:30:00");

Previous

❮ MySQL Functions

Next

Previous

MySQL TIME_FORMAT() Function

Next

MySQL TIMEDIFF() Function