8.2.9.20 datetime.localtime

Method: out = localtime (obj)

Convert to TM_STRUCT structure in UTC time.

Converts obj to a TM_STRUCT style structure array. The result is a local time in the system default time zone. Note that the system default time zone is always used, regardless of what TimeZone is set on obj.

If obj is unzoned, it is assumed to be in UTC time.

Returns a struct array in TM_STRUCT style.

Example:

dt = datetime;
dt.TimeZone = datetime.SystemTimeZone;
tm_struct = localtime (dt);