Official Content

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

Syntax

Year(Date-expression | DateTime-expression)

Where:

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:
Numeric(4)

Scope

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

Samples

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: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant