comparison m-toolbox/html_help/help/ug/constructor_examples_timespan_content.html @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 <!-- $Id: constructor_examples_timespan_content.html,v 1.1 2008/03/30 20:40:04 ingo Exp $ -->
2
3 <!-- -------------------------------------------------- -->
4 <!-- --------------- BEGIN CONTENT FILE --------------- -->
5 <!-- -------------------------------------------------- -->
6
7 <!-- --------------- Link box: begin --------------- -->
8 <table border="0" summary="Simple list" class="simplelist_nottable_last">
9 <tr>
10 <td>
11 <a href="constructor_examples_timespan.html#empty">Construct empty TIMESPAN object</a>
12 </td>
13 </tr>
14 <tr>
15 <td>
16 <a href="constructor_examples_timespan.html#xml_file">Construct a TIMESPAN object by loading the object from a file</a>
17 </td>
18 </tr>
19 <tr>
20 <td>
21 <a href="constructor_examples_timespan.html#start_end">Construct a TIMESPAN object with a start and end time</a>
22 </td>
23 </tr>
24 <tr>
25 <td>
26 <a href="constructor_examples_timespan.html#plist">Construct a TIMESPAN object from a parameter list (PLIST) object</a>
27 </td>
28 </tr>
29 </table>
30 <!-- --------------- Link box: end --------------- -->
31
32 <!-- --------------- NEXT EXAMPLE --------------- -->
33
34 <hr>
35 <h2 class="title"><a name="empty"></a>Construct empty TIMESPAN object</h2>
36 <p>The following example creates an empty timespan object</p>
37 <div class="fragment"><pre class="programlisting">
38 ts = timespan()
39 ---------- timespan 01 ----------
40
41 name : None
42 start : 2008-03-30 20:00:00.000
43 end : 2008-03-30 20:00:00.000
44 timeformat: yyyy-mm-dd HH:MM:SS.FFF
45 interval :
46 timezone : UTC
47
48 created : 2008-03-30 20:00:00.000
49 version : $Id: timespan.m,v 1.23 2008/03/25 10:57:49 mauro Exp
50 plist : plist class
51 ---------------------------------
52 </pre></div>
53
54 <!-- --------------- NEXT EXAMPLE --------------- -->
55
56 <hr>
57 <h2 class="title"><a name="xml_file"></a>Construct a TIMESPAN object by loading the object from a file</h2>
58 <p>The following example creates a new timespan object by loading the timespan object from disk.</p>
59 <div class="fragment"><pre class="programlisting">
60 t = timespan(<span class="string">'timespan.mat'</span>)
61 t = timespan(<span class="string">'timespan.xml'</span>)
62 </pre></div>
63
64 <!-- --------------- NEXT EXAMPLE --------------- -->
65
66 <hr>
67 <h2 class="title"><a name="start_end"></a>Construct a TIMESPAN object with a start and end time</h2>
68 <p>It is possible to specify the start-/end- time either with a time-object or with a time string.</p>
69 <div class="fragment"><pre class="programlisting">
70 t1_obj = time(<span class="string">'14:00:00'</span>);
71 t2_obj = time(<span class="string">'15:00:00'</span>);
72 t1_str = <span class="string">'14:00:00'</span>;
73 t2_str = <span class="string">'15:00:00'</span>;
74
75 ts1 = timespan(t1_obj, t2_obj) <span class="comment">% two time-objects</span>
76 ts2 = timespan(t1_obj, t2_obj) <span class="comment">% two strings</span>
77 ts3 = timespan(t1_str, t2_obj) <span class="comment">% combination of time-object and string</span>
78 ts4 = timespan(t1_str, t2_str) <span class="comment">% combination of time-object and string</span>
79 </pre></div>
80
81
82 <!-- --------------- NEXT EXAMPLE --------------- -->
83
84 <hr>
85 <h2 class="title"><a name="plist"></a>Construct a TIMESPAN object from a parameter list (PLIST) object</h2>
86 <p>Construct an TIMESPAN by its properties definition
87 <table border="0" summary="Simple list" class="simplelist_nottable_last" width="50%">
88 <tr valign="top">
89 <td width="25%">
90 <p>'start'</p>
91 </td>
92 <td width="75%">
93 <p>The starting time<br />[default: '1970-01-01 00:30:00.000']</p>
94 </td>
95 </tr>
96 <tr valign="top">
97 <td width="25%">
98 <p>'end'</p>
99 </td>
100 <td width="75%">
101 <p>The ending time<br />[default: '1980-01-01 12:00:00.010']</p>
102 </td>
103 </tr>
104 </table>
105 </p>
106 <p>Additional parameters:
107 <table border="0" summary="Simple list" class="simplelist_nottable_last" width="50%">
108 <tr valign="top">
109 <td width="25%">
110 <p>'timezone'</p>
111 </td>
112 <td width="75%">
113 <p>Timezone (string or java object) [default: 'UTC']</p>
114 </td>
115 </tr>
116 <tr valign="top">
117 <td width="25%">
118 <p>'timeformat'</p>
119 </td>
120 <td width="75%">
121 <p>Time format (string) [default: 'yyyy-mm-dd HH:MM:SS.FFF']</p>
122 </td>
123 </tr>
124 </table>
125 </p>
126 <div class="fragment"><pre class="programlisting">
127 t1 = time(<span class="string">'14:00:00'</span>);
128 t2 = time(<span class="string">'15:00:00'</span>);
129
130 pl1 = plist(<span class="string">'start'</span>, t1, ...
131 <span class="string">'end'</span>, t2);
132 pl2 = plist(<span class="string">'start'</span>, t1, ...
133 <span class="string">'end'</span>, t2, ...
134 <span class="string">'timeformat'</span>, <span class="string">'yyyy-mm-dd HH:MM:SS'</span>, ...
135 <span class="string">'timezone'</span>, <span class="string">'CET'</span>);
136
137 ts1 = timespan(pl1)
138 ts2 = timespan(pl2)
139 </pre></div>
140
141
142
143 <!-- ------------------------------------------------ -->
144 <!-- --------------- END CONTENT FILE --------------- -->
145 <!-- ------------------------------------------------ -->