I have a datetimepicker component in a Delphi form and I would like to just get the Time. When i look at the date in debug mode I see 42544.621701
, and I would like just to get 0.621701
without the date value.
You can use the Frac()
function:
var
Time: TTime;
...
Time := Frac(DateTimePicker1.DateTime);
Or, you can use the System.DateUtils.TimeOf()
function, which is merely an inlined wrapper around Frac()
with a more descriptive name:
uses
..., DateUtils;
var
Time: TTime;
...
Time := TimeOf(DateTimePicker1.DateTime);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With