tzoffset was introduced as of R2014b as amethod of datetime objects. However, you are trying to passnow to it, butnow is a serial date number, not a datetime object.
You can use
tzoffset(datetime('now'))
but by default datetime objects have no time zone, so NaN would be returned. You can experiment with
The timerange object is another of those opaque thingies TMW has fallen in love with that has useful stuff inside it that is hidden and not documented. :(
You can get the two interval values and the type of interval as two-step process--
s=timerange(t1,t2);
ss=struct(s); % convert the timerange object to a struct that reveals internals
t1=ss.first; % retrieve the start
t2=ss.last; % end times in timerange s
However, since you have to have set t1,t2 for the timeranage object when you created it; it would be more straightforward to create your own "object" or array of objects that contains the information for the specific tmerange then. At the convenience of not having to carry those around but being able to reconstruct on demand for any specific timerange at hand.
Best Answer