Convert old Date to Xojo.Core.Date

[quote=397775:@Björn Eiríksson]I am not sure what you are asking you get notify in the event when the value changes and you there notify the rest of your application and variables of the change.

If you for any reason want to read the value at random time then you just read the controls DateValue property.

Basically same as any other control works[/quote]
Unfortunately i can not show any example code TimeCtrl and DateCtrl (plugin) are not exported with the project.
I give an example :
I wrote Method to draw analogical clock, i want to move the needles shows.
when i modify “hour or minutes” the needles shows must move imidiately … , it means that the time inside my draw method changes when increasing or decreasing the hours or minutes in the Time Picker (TimeCtrl).

It is just like any other Xojo control, your get Value changed event, you Set your stored variable or property, you call invalidate on your “needles” drawing control and it draws what you have stored in your property. => Happens immediately

Understood, it happens. The methods called for drawing are also Invalidate.
Problem that the draw is not refreshed, overlapping , it means that the program keep the elapsed time in memory …
The drawing is moving properly no overlapping when time is introduced by TextField “hour”, Textfield “minutes”, etc …

Ah I think I know what you mean

There is delay in the date and time control entry…since else you could not enter some values. It needs to delay while you are entering to give you time to enter valid number before applying validations. So you have maybe half a second delay.

Before that delay was put there the user experience was sometimes horrible. Like if min date was 1.1.2001, and you start to enter 2001, then you type 2, and get validation and the year 2 would be to low. Input delay handles such so you can enter 2001 before validation happens. (Pretty standard practice for controls like this one)

[quote=398029:@Björn Eiríksson]Ah I think I know what you mean

There is delay in the date and time control entry…since else you could not enter some values. It needs to delay while you are entering to give you time to enter valid number before applying validations. So you have maybe half a second delay.

Before that delay was put there the user experience was sometimes horrible. Like if min date was 1.1.2001, and you start to enter 2001, then you type 2, and get validation and the year 2 would be to low. Input delay handles such so you can enter 2001 before validation happens. (Pretty standard practice for controls like this one)[/quote]

Unfortunately i have not found solution, The Date Time Picker((EinHugur Plugin) become uncontrollable, focus on the hour or minute does not respond, only the second change (increase or decrease) slowly …
Entering the time value by textfield run properly but … !

Public Function SecondsSince1904KSW(Extends d As DateTime) as Double
Return d.SecondsFrom1970+kSecondsBetween1904And1970+timeZone.Current.SecondsFromGMT
End Function

Public Function NewDateTimeFromLegacyDateTotalSeconds(d As Double) as DateTime
Return New DateTime(d-kSecondsBetween1904And1970-TimeZone.Current.SecondsFromGMT,TimeZone.Current)
End Function

Public Const kSecondsBetween1904And1970 as Number = 2082844800

Sub Open() Handles Open
Dim d As New Date
Dim dNew As New DateTime(d)

Dim dTS, dTS2 As Double
dTS = d.TotalSeconds
dTS2 = dNew.SecondsSince1904KSW

Dim dTrial As DateTime = NewDateTimeFromLegacyDateTotalSeconds(dTS2)
break
End Sub

Hi Josh,
i am still using 2015r1, DateTime() works only since 2019r2.
thank you