From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Read-Only Property (As Integer )
IntegerValue = aDateTime.Year

New in 2019r2

Supported for all project types and targets.

The year portion of the date.

Sample Code

The following code displays the current year.

Var d As DateTime = DateTime.Now
Label1.Text = d.Year.ToString