Table of Contents

Class Minute

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

Represents the MINUTE time extraction function that returns the minute component of a datetime.

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

Remarks

The MINUTE function extracts the minute as an integer (0-59) from a datetime or time value. For example, MINUTE('2024-03-15 14:30:00') returns 30. This is useful for time-based analysis, grouping by time intervals, or extracting specific time components.

Examples

Extract the minute component from each scheduled task timestamp:

var schema = manager.LoadSchema("scheduler");
var tasks = schema["tasks"];

var query = new Query()
    .Select([ tasks["id"], new Expression("start_minute", new Minute(tasks["scheduled_at"])) ])
    .From(tasks);

var results = manager.Retrieve(query);

Constructors

Minute(IEnumerable<IElement>)

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

Minute(IElement)

Initializes a new instance of MINUTE for any element.

Minute(Column)

Initializes a new instance of MINUTE for a column.

Minute(Expression)

Initializes a new instance of MINUTE for an expression.