how convert 13 digits of timestamp?
Afficher commentaires plus anciens
*hi,
how convert 13 digits of timestamp like 1238536800000 into small number with 6 digits It is easy to deal with it.
THANKS *
7 commentaires
Walter Roberson
le 5 Juil 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
le 5 Juil 2015
Azzi Abdelmalek
le 5 Juil 2015
You have the date. What is the problem?
Campion Loong
le 6 Juil 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
le 7 Juil 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.
Réponse acceptée
Plus de réponses (1)
Azzi Abdelmalek
le 5 Juil 2015
Modifié(e) : Azzi Abdelmalek
le 5 Juil 2015
use
format short
or
s=1238536800000
fprintf('%6.6g\n',s)
Catégories
En savoir plus sur Time Series Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!