how convert 13 digits of timestamp?
Mostrar comentarios más antiguos
*hi,
how convert 13 digits of timestamp like 1238536800000 into small number with 6 digits It is easy to deal with it.
THANKS *
7 comentarios
Walter Roberson
el 5 de Jul. de 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
el 5 de Jul. de 2015
Azzi Abdelmalek
el 5 de Jul. de 2015
You have the date. What is the problem?
Campion Loong
el 6 de Jul. de 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
el 7 de Jul. de 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.
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 5 de Jul. de 2015
Editada: Azzi Abdelmalek
el 5 de Jul. de 2015
use
format short
or
s=1238536800000
fprintf('%6.6g\n',s)
Categorías
Más información sobre Time Series Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!