필터 지우기
필터 지우기

Inserting current date in string

조회 수: 5 (최근 30일)
Syed Abbas
Syed Abbas 2012년 1월 17일
Hi,
I have a string such as follows:
st = 'Today is January 17 2012'
How can I automatically insert today's date in this string without manually typing it into the string. I am looking for something of the form:
st = 'Today is datestr(now)' - but obviously this does not produce the desired result.
Thanks,

채택된 답변

bym
bym 2012년 1월 17일
sprintf('today is %s',datestr(now()))

추가 답변 (1개)

Thomas
Thomas 2012년 1월 17일
Use:
str=['Today is ',date]

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by