Table of Contents

Class Year

Namespace
Albatross.Expression.Prefix
Assembly
Albatross.Expression.dll

Prefix expression that extracts the year component from a DateTime value. Returns an integer representing the year.

public class Year : PrefixExpression, IPrefixExpression, IExpression, IToken
Inheritance
Year
Implements
Inherited Members
Extension Methods

Constructors

Year()

Initializes a new instance of the Year class with name "Year" and exactly one parameter.

public Year()

Methods

Run(List<object>)

Extracts the year component from the provided DateTime operand.

protected override object Run(List<object> operands)

Parameters

operands List<object>

List containing exactly one operand that can be converted to DateTime.

Returns

object

An integer representing the year (e.g., 2024).

Exceptions

FormatException

Thrown when the operand cannot be converted to DateTime.