MATLAB: Won’t the following work? datetime(‘Thu Nov 16 14:04:15 CST 2017′,’Tim​eZone’,’lo​cal’,’Inpu​tFormat’,’​eee MMM dd HH:mm:ss z yyyy’)

datetimetimezonetimezone offset

Why won't the following work? datetime('Thu Nov 16 14:04:15 CST 2017','TimeZone','local','InputFormat','eee MMM dd HH:mm:ss z yyyy').
My Matlab version in R2017b.

Best Answer

Your hours are using 24-hour format. You need to use HH instead of hh.
datetime('Thu Nov 16 14:04:15 CST 2017','TimeZone','local','InputFormat','eee MMM dd HH:mm:ss z yyyy')