build YYYYMMDD instead of YYYYMD, for YY and DD derived from one-digit outputs from datevec()
이전 댓글 표시
Hello. I would like to produce a date (for instance: 7th of January 2014) string looking like '20140107' for representing YYYYMMDD, but a one digit M and D currently results in the unwanted string '201417', which is only YYYYMD.
[Y, M, D, H, MN, S] = datevec(now);
dateString =[num2str(Y),num2str(M),num2str(D)];
채택된 답변
추가 답변 (1개)
Mischa Kim
2014년 4월 30일
편집: Mischa Kim
2014년 4월 30일
Marco, how about
dateString = datestr(now,'yyyymmdd');
카테고리
도움말 센터 및 File Exchange에서 Detection, Range and Doppler Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!