nickdelphi777
asked on
C++'s DateTime.Now.Ticks.ToString() Equivalent in delphi?
DateTime.Now.Ticks.ToStrin g() in C++ what is the equivalent in delphi? The strings generated seem very different because I don't think GetTickCount() is the same.. thanks
my code:
string hash_id = Utilities.GetMd5Hash(DateTime.Now.Ticks.ToString());
hash_id = hash_id.Substring(0,8) + "-" + hash_id.Substring(8, 4) + "-" + hash_id.Substring(12, 4) + "-" + hash_id.Substring(16, 4) + "-" + hash_id.Substring(20, 12);
my code:
function sessionhash:string;
var
h,b:string;
begin
h := lowercase(md5string(DateToStr(GetTickCount())));
b := copy(h,0,8)+'-'+copy(h,8,4)+'-'+copy(h,12,4)+'-'+copy(h,16,4)+'-'+copy(h,20,12);
result := b;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
system.environment.tickcou