Specific timestamp to date format using datetime
Show older comments
I have data with a certain timestamp, being yyyymmddHHMM and I want to convert this to time format in matlab:
For example:
Given a timestamp of 201502171000 I want to get 2015-02-17 10:00.
PS: I have to manage a lot of data for a given time unit and my aim is to identify my measurements for that certain time unit. And thats why I thought that time format could be helpful.
Accepted Answer
More Answers (1)
Peter Perkins
on 27 Mar 2017
Assuming you have strings, not numbers, you've kind of answered the question yourself, except for m vs. M:
>> datetime('201502171000','InputFormat','yyyyMMddHHmm')
ans =
datetime
17-Feb-2015 10:00:00
Categories
Find more on Tables in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!