Convert datetime to string
283 views (last 30 days)
Show older comments
How can I convert
datetime('now','TimeZone','local','Format','d-MMM-y HH:mm:ss')
to a string with this structure: 12-Oct-2022_18:12:17
0 Comments
Accepted Answer
Adam Danz
on 12 Oct 2022
dt = datetime('now','TimeZone','local','Format','d-MMM-y HH:mm:ss')
dtstr = string(dt)
0 Comments
More Answers (0)
See Also
Categories
Find more on Data Type Conversion 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!