Autor Beitrag
Josef-B
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 293

2003 Server, Win7, Win8
Delphi 2010 Pro, Firebird 2.5
BeitragVerfasst: Do 12.04.07 16:38 
Also dieses Hexadezimalsystem und die Bytes kapier ich irgendwie nicht:

Ich habe jetzt in meiner Import-Datei vier Bytes mit folgenden Werten:

ausblenden Delphi-Quelltext
1:
2:
HEX:          46 0D 26 60
Dezimal:      70 13 38 96


Diese vier Bytes sollen ein Datum und Uhrzeit sein (laut Dateibeschreibung).

Wie kann man das denn konvertieren?

Noch ne Ergänzung: in der Satzbeschreibung steht als Datentyp TimeReal.

Nachtrag: Habe jetzt gelesen, dass es sich bei der Zahl um einen Integer-Wert handelt, der die Anzahl der Sekunden seit dem 01.01.1970 um 0.00 Uhr ist. Wie rechne ich den jetzt den HexWert in Dezimal Wert um?
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 12.04.07 20:48 
Hallo,

z.B.:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var Hex : String;
    Sekunden : Integer;
begin
  Hex := '460D2660';
  Sekunden := StrToInt('$' + Hex);

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Josef-B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 293

2003 Server, Win7, Win8
Delphi 2010 Pro, Firebird 2.5
BeitragVerfasst: Fr 13.04.07 16:59 
Ja genau, danke

hatte die ganze Zeit nach HexToInt oder so geschaut