writing date on an excel sheet

조회 수: 27 (최근 30일)
S
S 2011년 8월 24일
편집: Prieni 2017년 8월 18일
Hi folk,
Got a question about writing date on an excel sheet. I am using the following codes:
DATE=datestr(now);
xlswrite('test.xls', DATE, 'A1')
The problem is that it separates each number and letter and put them in separate cells. I want the whole date in one cell like 'A1' but it appears from 'A1' to 'T1'
I appreciate your help. Thank you.
S:-)
  댓글 수: 1
Prieni
Prieni 2017년 8월 18일
편집: Prieni 2017년 8월 18일
Just came across the problem to export date/time to an Excel sheet. If you do this:
DATE = now - datenum(1899,12,30,0,0,0);
xlswrite('test.xls',DATE)
you get a number in your Excel sheet that, if you change formatting to date, shows the current date. It also includes the current time which you can see when you select that date.

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

채택된 답변

Oleg Komarov
Oleg Komarov 2011년 8월 24일
xlswrite('test.xls', {datestr(now)})
  댓글 수: 2
S
S 2011년 8월 24일
Thank you very much Oleg:)
Rageeni sah
Rageeni sah 2014년 6월 10일
Hello, Is this code work for you??

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by