How to avoid dates being writen in scientific notation?

I made my dates using:
m(1,1) = str2num(datestr([2015,8,10,12,0,0],'yyyymmddhhMM'));
which writes date in scientific notation into m. Is there any way to avoid that? I want my dates to be as simple as 201508101200 in m.

 채택된 답변

Jeff E
Jeff E 2015년 8월 10일
If you really want it as an integer:
m = uint64(str2num(datestr([2015,8,10,12,0,0],'yyyymmddhhMM')));

댓글 수: 1

Thanks a lot. That resolved my issue. I still had to to a bit of a trick on my matrix. Actually, that cell where date is stored in is not the first cell in my matrix. It's in the second column. So if I start by filling in first column with some other values, it still writes my dates in scientific notation cause the matrix is going to be double. So, I first wrote in the 2nd column with dates through how you showed me to make the matrix a uint64 and then wrote in the first columns.
Thanks again.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Dates and Time에 대해 자세히 알아보기

질문:

2015년 8월 10일

댓글:

2015년 8월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by