conversion of hexadecimal timestamps

I have dates and times as hexadecimal timestamps. I want to convert them into date vectors or the like. Is there a way to do this in Matlab?

 Risposta accettata

Stephen23
Stephen23 il 2 Ago 2016
Modificato: Stephen23 il 2 Ago 2016
>> datevec(hex2dec('577aaa0e')/86400 + datenum(1970,1,1))
ans =
2016 7 4 18 25 18
The HEX date likely encodes a UNIX timestamp, if so the above conversion will convert this into a MATLAB datevec.

Più risposte (1)

Azzi Abdelmalek
Azzi Abdelmalek il 2 Ago 2016
Modificato: Azzi Abdelmalek il 2 Ago 2016
use hex2dec command
a='10'
b=hex2dec(a)

3 Commenti

I tried that but it doesn't solve my problem. I still get a decimal timestamp which I can't translate into dates and times as a vector.
One example. I have a timestamp '577aaa0e' which stands for '2016-07-04 20:25:18'. I need some command that does this conversion.
How your hexadecimal number is related to your date?
the hexadecimal timestamp is generated automatically, presumably it is a unix feature.

Accedi per commentare.

Categorie

Richiesto:

il 2 Ago 2016

Commentato:

il 2 Ago 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by