How to convert a char into datetime variable?
8 次查看(过去 30 天)
显示 更早的评论
Hello, how can I convert a char such as '11:04:55' to datetime variable?
Thank you very much.
0 个评论
采纳的回答
Guillaume
2019-3-21
datetime('11:04:55')
Note that it will use the current date for the date part (since a datetime is always date + time as the name indicates). If you do not want the date to display (it will still be stored and can be accessed):
datetime('11:04:55', 'Format', 'HH:mm:ss')
duation('11:04:55')
Just as easy.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!