Tabular IQ
Back to Function Index

SECOND()

Overview

SECOND() extracts the second component from a date value. This function is useful for time-based analysis, filtering, and calculations where you need to work with the seconds portion of a timestamp.

Function Format

SECOND(date)

Return Value

SECOND() returns an integer

Examples


// Extract seconds from a specific date and time
SECOND(DATE(2007, 07, 04, 12, 30, 22)) = 22

// Extract seconds from another date and time
SECOND(DATE(2007, 12, 25, 8, 10, 20)) = 20

// Additional examples
SECOND(DATE(2024, 01, 01, 00, 00, 59)) = 59
SECOND(DATE(2024, 01, 01, 23, 59, 00)) = 0

Notes

  • Important behaviors:
    • Returns seconds as an integer (0-59)
    • Requires a valid date input
    • Extracts only the seconds component
    • Ignores milliseconds if present
  • Common use cases include:
    • Time-based filtering
    • Time analysis
    • Data aggregation by seconds
    • Time calculations
    • Event timing analysis
  • The function is useful for:
    • Extracting seconds from timestamps
    • Time-based data processing
    • Precise time measurements
    • Time component analysis

See Also