Calculating duration between dates in a CSV file and the present date
조회 수: 8 (최근 30일)
이전 댓글 표시
I am reading data from csv file which has a column that has date in the format like 5 Jun 2021. I want to calculate the duration between each date and present date. How can I do this?
댓글 수: 0
채택된 답변
Samay Sagar
2023년 6월 14일
You can use the between function to calculate duration between 2 dates. You can iterate over each value in column and apply the following operation :
currentDate = datetime('now');
givenDate = datetime('5-Jun-2021');
duration = between(givenDate,currentDate)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!