MATLAB: Does isdst work

datetimedaylight savings timeisdstMATLAB

Tried this today in Greenville Texas (CST)
>> isdst(datetime('now'))
0
Everything I read says Daylight Savings Time is from 2nd Sunday in March to 1st Sunday in November, so we should be in Daylight Savings Time now…
Have tried this with other dates too; i.e.,
>>isdst(datetime('062316','Format','MMddyy'))
0
23Jun2016 should have been in DST.
Looks like this is buggy?

Best Answer

datetime('now') is an example of an "unzoned" time -- it has no timezone attached. isdst() only works for datetime objects that have timezones.
>> isdst(datetime('now', 'timezone', 'America/Winnipeg'))
ans =
logical
1