DateTime.Hour

From Xojo Documentation

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

New in 2019r2

Supported for all project types and targets.

The hour number of the time portion of the date, using a 24-hour clock.

Sample Code

The following example displays the current hour.

Var d As DateTime = DateTime.Now
Label1.Value = d.Hour.ToString