Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

TIME_TO_SEC

Example

Convert a time value to its equivalent in seconds.

SELECT TIME_TO_SEC(“19:30:10”);

Definition and Usage

The TIME_TO_SEC() function converts a given time value into its equivalent in seconds.

Syntax

TIME_TO_SEC(time)

Parameter Values

Parameter

Description

time

Required: The time value to convert

Technical Details

Works in:

 From MySQL version 4.0

More Examples

Example

SELECT TIME_TO_SEC(“00:00:05”);

Example

Convert a given time value into seconds.

SELECT TIME_TO_SEC(“03:30:00.999999”);

Example

Convert a specified time value into its equivalent in seconds.

SELECT TIME_TO_SEC(“-03:30:00”);