Documentation/Calc Functions/SECOND/en

Function name:
SECOND

Category:
Date and Time

Summary:
Determines the seconds value from a date expression passed as a date-time serial number or a text string.

Syntax:
SECOND(DateTime)

Returns:
Returns a positive integer in the range 0 to 59 which is the seconds value of the given date expression.

Arguments:
DateTime is the date expression (in quotation marks) or a date-time serial number, or a reference to the cell containing one of those types, from which the seconds is to be extracted.


 * If DateTime does not contain a valid date expression, then SECOND reports a #VALUE! error.
 * If DateTime does not contain any time component, then SECOND returns 0 (time 00:00:00).

Details specific to SECOND function
The equation for SECOND is:


 * SECOND = ROUND(MinuteFraction * 60)

where,


 * DayFraction = DateTime – INT(DateTime)
 * HourFraction = (DayFraction * 24) - INT(DayFraction * 24)
 * MinuteFraction = (HourFraction * 60) - INT(HourFraction * 60)

Take care to understand the function’s behaviour if you ever need to pass date expressions corresponding to negative date-time serial numbers to SECOND (these are dates prior to that selected as the base date on the dialog). For example, if you pass a positive date-time serial number with a fractional part equivalent to (1/(24*3600)) to SECOND, then it will return the value 1. However, if you pass a negative date-time serial number with a fractional part equivalent to (1/(24*3600)) to SECOND, then it will return the value 59.

Related LibreOffice functions:
DAY

HOUR

MINUTE

MONTH

ODF standard:
Section 6.10.16, part 2

Equivalent Excel functions:
SECOND