Separating datetime data ('yyyy-MM-dd HHmm:ss' Into 'hh:mm:ss')
8 views (last 30 days)
Hi, Community ~
I have a simple question... I have a datetime data like this :
I just want to know, how to convert it or extract the data to become duration only? (I want to get the duration Data only)
Whats the code for the extraction or conversion? Thank you so much...
dpb on 3 Dec 2021
NB: When you have an area of functionality but don't know the function name, the "Functions" link at the top of the documentation page for any function in the area for which you do know the name will provide an annotated list of all the related functions.
In this case, if you bring up the doc for datetime, you'll have that link at the top of the page and will find timeofday listed.
I notice the description for it isn't the best; I'll try to take the time to write a suggestion for upgrading the documentation; it has the function listed in area to return numeric values which could be improved to note it returns a duration.
It took me ages to figure this out in the new documentation myself; before there was the lookfor function at the command line or help for a toolbox or area of a given set of functionalities by the area of the MATLABPATH folder; that hasn't been kept up and owing to the massive growth of functionality it isn't nearly as useful as it once was -- but the "functions" list is invaluable tool.