Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TimeToInt(Value: TDateTime): Integer;
- begin
- Result:= (HourOf(Value) shl 26)
- or (MinuteOf(Value) shl 20)
- or (SecondOf(Value) shl 14 )
- or (MilliSecondOf(Value));
- end;
- function IntToTime(Value: Integer): TDateTime;
- var h,m,s,ms: Integer;
- begin
- h := Value shr 26;
- m := Value shr 20 and $3F;
- s := Value shr 14 and $3F;
- ms := Value and $3FFF;
- Result:=EncodeTime(h,m,s,ms);
- end
Advertisement
Add Comment
Please, Sign In to add comment