How convert date and time to number that excel will recognize the really date and time?

조회 수: 1 (최근 30일)
I need to convert a column that contains dates to numbers and a column that contains time to number also in order to be able to perform some processes. I tried x2mdate and datenum but when I open the file with excel and I convert it again to date and time respectively the excel doesn't recognize the real dates and times. What is my wrong?
Thank you in advance
  댓글 수: 1
Peter Perkins
Peter Perkins 2016년 9월 23일
Kelly, I don't think you've provided enough information to answer your question. What exactly are your dates and times stored as, you writing to a file or working within MATLAB, and so on.

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

답변 (1개)

George
George 2016년 9월 23일
A = table(datetime());
writetable(A, 'myfile.xlsx');
  댓글 수: 3
Walter Roberson
Walter Roberson 2016년 9월 23일
If the dates and times are in two cell arrays, then you can use
strjoin(dates_cell(:), {' '}, times_cell(:))
George
George 2016년 9월 23일
In addition to Walter's comment you can look at the datetime format properties.

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

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by