Table of Contents

Class Second

Namespace
YndigoBlue.Velocity.Functions
Assembly
YndigoBlue.Velocity.dll

Represents the SECOND time extraction function that returns the second component of a datetime.

public class Second : Function, ICheckItem, IDefaultItem, IFilterItem, IElement
Inheritance
Second
Implements

Remarks

The SECOND function extracts the second as an integer (0-59) from a datetime or time value. For example, SECOND('2024-03-15 14:30:45') returns 45. This is useful for precise time analysis, sub-minute calculations, or extracting exact timing information.

Examples

Extract the second component from each high-precision timestamp:

var schema = manager.LoadSchema("telemetry");
var readings = schema["readings"];

var query = new Query()
    .Select([ readings["id"], new Expression("second_part", new Second(readings["captured_at"])) ])
    .From(readings);

var results = manager.Retrieve(query);

Constructors

Second(IEnumerable<IElement>)

Initializes a new instance of SECOND for a composed expression (e.g. SECOND(DATEADD(...))).

Second(IElement)

Initializes a new instance of SECOND for any element.

Second(Column)

Initializes a new instance of SECOND for a column.

Second(Expression)

Initializes a new instance of SECOND for an expression.