Way to import time series date string as mm-dd-yyyy

조회 수: 2 (최근 30일)
Chris
Chris 2011년 9월 20일
My data is in the format of mm-dd-yyyy hh:mm:ss however it seems like the time series import tool will only import dates & time data if the format is in dd-mmm-yyyy hh:mm:ss
  댓글 수: 1
Jan
Jan 2011년 9월 20일
What exactly is your question? Can you post the type of the available input and wanted output?

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

채택된 답변

Jan
Jan 2011년 9월 20일
You can convert the data manually:
S1 = '07-12-2011 13:14:15'
D = datenum(S1, 'mm-dd-yyyy HH:MM:SS');
S2 = datestr(D, 'dd-mmm-yyyy HH:MM:SS')

추가 답변 (2개)

Chris
Chris 2011년 9월 20일
Hi Jan
I am using the tsimport tool however the date time import only accepts the 3 digit month and not 2 digit month with the time. I have to have both the time and dates in the time series.
  댓글 수: 2
Jan
Jan 2011년 9월 20일
Sorry for repeating: What is your question? How can we help you?
Fangjun Jiang
Fangjun Jiang 2011년 9월 20일
Time series supports all the data format. What tsimport tool are you using?

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


Chris
Chris 2011년 9월 21일
Thanks when I run tstool, and go file create time series from file. I then select a csv file. Columns A & B which are the date and time are in the format mm:dd:yyy and column b is the time as hh:mm:ss
I would like my time series imported to have both the date and time. However under the specify time vector, define it now date string option for format there is only dd-mmm-yyy hh:mm:ss which unfortunately requires a 3 character month such as 20-sep-2011. Unfortunately my data files are 20-09-2011. Is there a way for it to easily convert the 09 to Sep or have the tstool change the 09 to sep.

카테고리

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