DateTime.Constructor(source As DateTime)

From Xojo Documentation

Constructor

DateTime.Constructor(source As DateTime)

New in 2019r2

Creates a new DateTime object that has the same date time information as the passed DateTime.

Sample Code

The following code sets the new DateTime to the previously created date and then displays it in a Label.

Var d1 As New DateTime(1956, 8, 13)
Var d2 As New DateTime(d1)
Label1.Value = d2.ToString(Locale.Current, DateTime.FormatStyles.Short)