MySQL SECOND() Function

Example

Return the seconds part of a datetime value:

SELECT SECOND("2017-06-20 09:34:00.000023");
Try it Yourself »

Definition and Usage

The SECOND() function returns the seconds part of a time/datetime (from 0 to 59).

Syntax

SECOND(datetime)

Parameter Values

Parameter Description
datetime Required. The time or datetime to extract the second from

Technical Details

Works in: From MySQL 4.0

More Examples

Example

Return the seconds part of a time value: 

SELECT SECOND("23:59:59");
Try it Yourself »

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