Calculating duration between dates in a CSV file and the present date
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Vinay
am 14 Jun. 2023
Beantwortet: Samay Sagar
am 14 Jun. 2023
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 Kommentare
Akzeptierte Antwort
Samay Sagar
am 14 Jun. 2023
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!