Set the long date format:
Add variables as End Date:
Add variables like the other two.
Double-click Start date to add message processing: Date time has changed:
Add a date to change the message handler function:
Add date to end date change message processing:
Because the end date date changes to the same handler as the start date, encapsulation is a function, and making a call avoids writing two times:
Date subtraction is calculated within the encapsulated function, calculating the number of days between two date intervals:
+1 including the day after
Modify the ID of the time control
Add time to time to change the message handler function:
The same time changes the time processing encapsulated into functions to invoke:
Below, the call is made in two times of changing message processing, respectively:
Compile error, remember to check ID:
If an error occurs, check the code for the wrong place:
The effect is as follows:
To output for all hours all minutes for all seconds:
From for notes (Wiz)
Cheetah Mfc--datatimepicker Date Time Select control Cdatatimectrl CTime ctimespan time interval