Function year()
extracts the year of a time value and returns that integer.
Arguments:
- Time <datetime | timestamp | string>
Returns:
- Year <number>
Constant
Example: Return the year of "2020-01-02 00:05:32"
return year("2020-01-02 00:05:32")
Function
Example: Return the year of current system time
return year(now())
Alias
Example: Find 10 cards, return their expiry year
find().nodes({@card}) as n
limit 10
return year(n.expire_date)
Property
Example: Find 10 cards expiring this year
find().nodes({year(@card.expire_date) == year(now())}) as n
limit 10
return n{*}