From date and time in different columns to datetime
Show older comments
Hey, I have an array with date (yyyy-mm-dd) in one columns and time (hh:mm:ss) in another like this:
2017-09-29 21:00:00
2017-09-29 22:00:00
2017-09-29 23:00:00
2017-09-30 00:00:00
2017-09-30 01:00:00
2017-09-30 02:00:00
2017-09-30 03:00:00
How can I make this array into a datetime array?
1 Comment
Andrei Bobrov
on 20 Mar 2018
Edited: Andrei Bobrov
on 20 Mar 2018
Please attach an example of your data (as mat-file) so that we know what type of data you are using.
Accepted Answer
More Answers (1)
Andrei Bobrov
on 20 Mar 2018
Edited: Andrei Bobrov
on 20 Mar 2018
datetime('2017-09-29') + hours(21:27)'
Categories
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!