How to convert a char into datetime variable?

10 ビュー (過去 30 日間)
Marianna Pizzo
Marianna Pizzo 2019 年 3 月 21 日
コメント済み: Marianna Pizzo 2019 年 3 月 21 日
Hello, how can I convert a char such as '11:04:55' to datetime variable?
Thank you very much.

採用された回答

Guillaume
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')
You may want to use a duration type instead of datetime.
duation('11:04:55')
Just as easy.
  1 件のコメント
Marianna Pizzo
Marianna Pizzo 2019 年 3 月 21 日
Thank you very much.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by