Official Content

Returns the numeric year identifier of a given date. If the received parameter is null, zero (0) is returned.

Syntax

Date | DateTime.Year()

Type returned:
Numeric N(4)

Scope

Data Types: Date, DateTime

Samples

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

&ThisYear = Today.Year()

A string displaying text next to the year:

&TxtYear = 'Year:' + str(&Today.Year())

See Also

TimeZone Support - General Considerations
Year function
Month method
Day method







Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant