MySQL TIME_TO_SEC() Function

Example

Convert a time value into seconds:

SELECT TIME_TO_SEC("19:30:10");
Try it Yourself »

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");
Try it Yourself »

Example

Convert a time value into seconds:

SELECT TIME_TO_SEC("03:30:00.999999");
Try it Yourself »

Example

Convert a time value into seconds:

SELECT TIME_TO_SEC("-03:30:00");
Try it Yourself »

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.