datestr format in lower case

Hello all, I want to express my serial date number in the form of 'ddd, mmm, yyyy', with ddd and mmm in lower case, but matlab is giving me back the date with the first letter of the day/month capitalized. How can I change it to lower case?

 채택된 답변

Arnaud Miege
Arnaud Miege 2011년 4월 19일

0 개 추천

Can you use the lower function to convert the string to lowercase?
HTH,
Arnaud

추가 답변 (2개)

Jan
Jan 2011년 4월 19일

1 개 추천

lowerDate = lower(datestr(now, 'ddd, mmm, yyyy'))
Or much faster with manual conversion:
function Str = DateStrFormat(Num)
month = ['jan'; 'feb'; 'mar'; 'apr'; 'may'; 'jun'; ...
'jul'; 'aug'; 'sep'; 'oct'; 'nov'; 'dec'];
day = ['mon'; 'tue'; 'wed'; 'thu'; 'fri'; 'sat', 'sun'];
[y, m, d] = datevecmx(Num);
Str = sprintf('%s, %s, %.4d', ...
day(rem(floor(Num), 7) + 1), month(m), y);
Natalia
Natalia 2011년 4월 19일

0 개 추천

Thanks both.

카테고리

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

질문:

2011년 4월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by