I have an array of date time values. How do I separate Date and time and enter it in separate columns in excel?

Answers (2)

Assuming you have a datetime array called DateAndTime which is a column vector:
Date = dateshift(DateAndTime,'start','day')
Time = timeofday(DateAndTime)
writetable(table(Date,Time),'file.xlsx')

Categories

Tags

Asked:

on 27 Feb 2019

Answered:

on 27 Feb 2019

Community Treasure Hunt

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

Start Hunting!