I've a sequence of UNIX timestamps in milliseconds (e.g. 1491009470000). I want to convert them to human time in the format year-month-date-hour-minute-second (or in an array of these components). Following , I tried datestr: dt = datestr(1491009470000,'mmmm dd, yyyy HH:MM:SS'), only to have the error:

Error using dateformverify (line 28) DATESTR failed converting date number to date vector. Error in datestr (line 194) S = dateformverify(dtnumber, dateformstr, islocal); Caused by: Error using datevecmx Date number out of range.

Unfortunately, datevecmx doesn't seem to have a documentation in MATLAB 2014a.

However, datestr(now,'mmmm dd, yyyy HH:MM:SS.FFF AM') gives us just what we need. So, how do I get the datestr (or any other MATLAB command) to give us the human time? Thanks in advance!

8

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy