Thema: Delphi Skype Timestamp format

Einzelnen Beitrag anzeigen

Benutzerbild von jfheins
jfheins

Registriert seit: 10. Jun 2004
Ort: Garching (TUM)
4.579 Beiträge
 
#2

Re: Skype Timestamp format

  Alt 22. Apr 2009, 20:11
Da steht doch:
Zitat:
Time stamp
The timestamps in records are stored in the standard UNlX format of seconds since 1/1/1970
00:00:00. However the data isn't represented as the standard 4 byte unsigned integer as is
usually the case, instead using 5 bytes to represent the timestamp with the format below
(where 'd' indicates a bit of data):

0000dddd 1ddddddd 1ddddddd 1ddddddd 1ddddddd

Stripping the leading 0's from this and removing the '1' at the most significant bit or each byte
yields 32 bits of information. If these are concatenated into 4 bytes, the number can be
handled using standard time functions. It is unknown why this format has been chosen.
Du musst also die Bits entsprechend zusammenfrickeln und darauf auchten, dass es keine Delphi-Zeit ist, sondern Unix-Timestamp.

Evtl. sind die Bytes auch umgedrecht - weil das hinterste rote Byte vorne ein 0-Nibble hat isses wahrscheinlich das erste Bytes des Zeitstempels

Warum die Entwickler davon abweichen kann viele Gründe haben. Einer ist vielleicht, dass es andere nicht so einfach haben, die Daten auszulesen

Probiers mal so in etwa: (Daten aus deiner Datei genommen)

Wert: Cardinal = 0;
Wert := Wert or BD;
Wert := Wert or A8 shl 7;
Wert := Wert or 88 shl 14;
Wert := Wert or CF shl 21;
Wert := Wert or 04 shl 28;
Zeit : TDatetime = UnixToDatetime(Wert);
  Mit Zitat antworten Zitat