Transformar Hexadecimal para TDate, tem como ?
Olá a Todos,
estou com essa função pra transformar data de tipo TDate para Hexadecimal.
Gostaria tb de fazer o inverso,
Tem como ??
Desde já agradeço.
Ex.: (25/09/2003) corresponde a ´04395F´
function ChaveData(Data:TDate):string;
var
DigVer:string;
Temp,i:Integer;
begin
DigVer := inttostr(trunc(Data));
Temp := 0;
for i:=1 to length(DigVer) do begin
Temp := Temp + i * ord(DigVer[i]) + (3 * i) + (trunc(data) div i) *
(i * i);
end;
Result := inttohex(temp,6);
end;
estou com essa função pra transformar data de tipo TDate para Hexadecimal.
Gostaria tb de fazer o inverso,
Tem como ??
Desde já agradeço.
Ex.: (25/09/2003) corresponde a ´04395F´
function ChaveData(Data:TDate):string;
var
DigVer:string;
Temp,i:Integer;
begin
DigVer := inttostr(trunc(Data));
Temp := 0;
for i:=1 to length(DigVer) do begin
Temp := Temp + i * ord(DigVer[i]) + (3 * i) + (trunc(data) div i) *
(i * i);
end;
Result := inttohex(temp,6);
end;
Christian_adriano
Curtidas 0
Respostas
Christian_adriano
07/09/2004
Olá pessoal,
me dê um help ae !!!
Flw...
C.A.
me dê um help ae !!!
Flw...
C.A.
GOSTEI 0
Kenshindigital
07/09/2004
se for so data (sem a hora) creio que deve funcionar o seguinte (nao testei)
//data pra hex
function datetohex(data:tdate):string
result:=inttohex(trunc(data),16)
//hex pra data
function hextodate(hexdata:string):tdate
result:=tdate(strtoint(´$´+hexdata))
//data pra hex
function datetohex(data:tdate):string
result:=inttohex(trunc(data),16)
//hex pra data
function hextodate(hexdata:string):tdate
result:=tdate(strtoint(´$´+hexdata))
GOSTEI 0