LTPDA Toolbox™ | contents | ![]() ![]() |
The following example creates an empty timespan object
ts = timespan() ---------- timespan 01 ---------- name : None start : 2008-03-30 20:00:00.000 end : 2008-03-30 20:00:00.000 timeformat: yyyy-mm-dd HH:MM:SS.FFF interval : timezone : UTC created : 2008-03-30 20:00:00.000 version : $Id: timespan.m,v 1.23 2008/03/25 10:57:49 mauro Exp plist : plist class ---------------------------------
The following example creates a new timespan object by loading the timespan object from disk.
t = timespan('timespan.mat') t = timespan('timespan.xml')
It is possible to specify the start-/end- time either with a time-object or with a time string.
t1_obj = time('14:00:00'); t2_obj = time('15:00:00'); t1_str = '14:00:00'; t2_str = '15:00:00'; ts1 = timespan(t1_obj, t2_obj) % two time-objects ts2 = timespan(t1_obj, t2_obj) % two strings ts3 = timespan(t1_str, t2_obj) % combination of time-object and string ts4 = timespan(t1_str, t2_str) % combination of time-object and string
Construct an TIMESPAN by its properties definition
'start' |
The starting time |
'end' |
The ending time |
Additional parameters:
'timezone' |
Timezone (string or java object) [default: 'UTC'] |
'timeformat' |
Time format (string) [default: 'yyyy-mm-dd HH:MM:SS.FFF'] |
t1 = time('14:00:00'); t2 = time('15:00:00'); pl1 = plist('start', t1, ... 'end', t2); pl2 = plist('start', t1, ... 'end', t2, ... 'timeformat', 'yyyy-mm-dd HH:MM:SS', ... 'timezone', 'CET'); ts1 = timespan(pl1) ts2 = timespan(pl2)
![]() |
Constructor examples of the RATIONAL class | Constructor examples of the PLIST class | ![]() |
©LTP Team