How can the seconds be removed from a TTime variable without resorting to the extra overhead of using TimeToStr(const datetime:TDateTime; const formatsettings:TFormatSettings) to get the TTime value without the seconds?
ie this is what I need -> HH:MM:00.
Is there some kind of math operation (like ANDing or ORing the value with something) that can be performed?
uses
..., DateUtils;
var
t: TTime;
begin
t := ...;
t := RecodeSecond(t, 0);
end;
var
t: TTime;
iHour, iMin, iSec, iMSec: Word;
DecodeTime(t, iHour, iMin, iSec, iMSec);
t := EncodeTime(iHour, iMin, 0, 0);
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