how convert 13 digits of timestamp?
Ältere Kommentare anzeigen
*hi,
how convert 13 digits of timestamp like 1238536800000 into small number with 6 digits It is easy to deal with it.
THANKS *
7 Kommentare
Walter Roberson
am 5 Jul. 2015
Please give us a sample timestamp and the exact time that it represents. Are the timestamps relative or absolute times? Are they possibly something like microseconds since a fixed time (as seen in MS Windows sometimes) ?
nada ali
am 5 Jul. 2015
Azzi Abdelmalek
am 5 Jul. 2015
You have the date. What is the problem?
Campion Loong
am 6 Jul. 2015
Hi Nada,
If you have MATLAB 2014b or above, you can also use datetime to accomplish what you need. For example:
>> myDate = datetime(730851,'ConvertFrom','datenum')
myDate =
31-Dec-2000 00:00:00
Then you can conveniently extract various datetime components such as:
>> myYear = year(myDate)
myYear =
2000
nada ali
am 7 Jul. 2015
@nada ali: what epoch and increment does that timestamp have? Without knowing what time system or encoding this timestamp uses, your question is impossible to answer.
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 5 Jul. 2015
Bearbeitet: Azzi Abdelmalek
am 5 Jul. 2015
use
format short
or
s=1238536800000
fprintf('%6.6g\n',s)
Kategorien
Mehr zu Time Series Objects finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!