Separate date and time
11 次查看(过去 30 天)
显示 更早的评论
I have the datetime in a column as given in an attached example excel sheet. Between date and time there is an alphabet T. Can I get a help to seperate out date and time.
Thanks!
0 个评论
回答(1 个)
Steven Lord
2021-9-21
dt = datetime('now') % Sample data
theTime = timeofday(dt)
theDate = dt - theTime % or
theDate2 = dateshift(dt, 'start', 'day')
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calendar 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!