Official Content

Returns the year number in a given date. If the received parameter is null, zero is returned.


Year(Date-expression | DateTime-expression)


Date-expression | DateTime-expression    
   Is any valid expression that can involve constants, functions, methods, Procedures, variables, attributes, Inline Formulas. The result must match the Date data type or DateTime data type

Type returned:


Objects: Procedure, Transaction, Web Panel, Panel, Data Provider
Generators: .NET, .NET Framework, Java, Apple, Android, Angular


To obtain the current year and assign it to a variable:

&ThisYear = Year(Today())

And next year:

&NextYear = Year(Now()) + 1

See Also

TimeZone Support - General Considerations
Year method
Month function
Day function


Last update: November 2023 | © GeneXus. All rights reserved. GeneXus Powered by Globant