Autor Beitrag
Nano-Ware
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 7



BeitragVerfasst: So 20.03.11 11:56 
Hey,

eine Konsole schreibt in vor jeden Output die Zeit im HEX - System. Wie kann man das entschlüsseln?
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: So 20.03.11 12:05 
wird von der Codierung abhängen, wenn Du keine Dokumentation hast könnten zwei Ausgaben (zu abweichenden Zeiten) mit den dazugehörigen Zeitangaben aus dem System bei der Entschlüsselung helfen.

_________________
Das Problem liegt üblicherweise zwischen den Ohren H₂♂
DRY DRY KISS
Nano-Ware Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 7



BeitragVerfasst: So 20.03.11 12:24 
kann man hex nicht einfach in Dezimal umwandeln?

EDIT:// Hab mal die Ausgaben nach Dezimal konvertiert:

ca 11:21: 1300616460

ca. 5 sekunden später: 1300616465

Also man erkennt da schon deutlich was, nur was?^^ Sind das diese Sekunden seit was weiß ich wann, mit denen auch Delphi das Datum ect anzeigt?
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: So 20.03.11 12:48 
ohne Gewähr ....
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Function GetGMT(Value:Integer):TDateTime;
var
  y,m,d,h,n,s:Word;
begin
   DecodeDate(Value / 60/60/24,y,m,d);
   Result := EncodeDate(y+70,m,d) + Frac(Value / 60/60/24);
end;

_________________
Das Problem liegt üblicherweise zwischen den Ohren H₂♂
DRY DRY KISS
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 20.03.11 13:28 
Ich denke das werden die Sekunden ab eine bestimmten Startdatum sein. Musst nur herausfinden welches. Der 1.1.1970 wäre ein Kandidat.
Nano-Ware Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 7



BeitragVerfasst: So 20.03.11 16:36 
Also ich hab mit mit dem TDate Objekt noch nie auseinandergesetzt. Bummi dein Code gibt nur ein Datum aus keine Uhrzeit. Außerdem ist es um 2 Tage falsch (18.03.2011 statt 20.) ich schau mir gleich mal die zwei Funktionen an!

Also wie kann man aus "Sekudnen seit 1970" ein normales Datum und Uhrzeit machen? (mit Beachtung, dass wir nicht in Greenwich leben)
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: So 20.03.11 20:22 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
uses DateUtils;
...

Memo1.Lines.add (DateTimeToStr(UnixToDatetime(1300616460)));

_________________
Das Problem liegt üblicherweise zwischen den Ohren H₂♂
DRY DRY KISS