I have the datetime in a column as given in an attached example excel sheet. Between date and time there is an alphabet T. Can I get a help to seperate out date and time.
Thanks!

답변 (1개)

Steven Lord
Steven Lord 2021년 9월 21일

2 개 추천

dt = datetime('now') % Sample data
dt = datetime
21-Sep-2021 19:44:52
theTime = timeofday(dt)
theTime = duration
19:44:52
theDate = dt - theTime % or
theDate = datetime
21-Sep-2021
theDate2 = dateshift(dt, 'start', 'day')
theDate2 = datetime
21-Sep-2021

댓글 수: 2

MatLab Code N
MatLab Code N 2021년 9월 21일
I have also attached the example datetime along with the question. How can I make this work for my data?
MatLab Code N
MatLab Code N 2021년 9월 22일
@Steven Lord any help is highly appreciated sir!

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

카테고리

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

제품

릴리스

R2019b

태그

질문:

2021년 9월 21일

댓글:

2021년 9월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by