Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/constructor_examples_time_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_time_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_time.html#empty">Construct empty TIME object</a> | |
12 </td> | |
13 </tr> | |
14 <tr> | |
15 <td> | |
16 <a href="constructor_examples_time.html#xml_file">Construct a TIME object by loading the object from a file</a> | |
17 </td> | |
18 </tr> | |
19 <tr> | |
20 <td> | |
21 <a href="constructor_examples_time.html#string">Construct a TIME object from a string</a> | |
22 </td> | |
23 </tr> | |
24 <tr> | |
25 <td> | |
26 <a href="constructor_examples_time.html#string_format">Construct a TIME object from a string and time format</a> | |
27 </td> | |
28 </tr> | |
29 <tr> | |
30 <td> | |
31 <a href="constructor_examples_time.html#epoch">Construct a TIME object from the unix epoch time</a> | |
32 </td> | |
33 </tr> | |
34 <tr> | |
35 <td> | |
36 <a href="constructor_examples_time.html#plist">Construct a TIME object from a parameter list (PLIST) object</a> | |
37 </td> | |
38 </tr> | |
39 <tr> | |
40 <td> | |
41 <a href="constructor_examples_time.html#"></a> | |
42 </td> | |
43 </tr> | |
44 </table> | |
45 <!-- --------------- Link box: end --------------- --> | |
46 | |
47 <!-- --------------- NEXT EXAMPLE --------------- --> | |
48 | |
49 <hr> | |
50 <h2 class="title"><a name="empty"></a>Construct empty TIME object</h2> | |
51 <p>The following example creates an empty time object</p> | |
52 <div class="fragment"><pre class="programlisting"> | |
53 t = time() | |
54 ---------- time 01 ---------- | |
55 | |
56 name : None | |
57 utc_epoch_milli: 1206904199919 | |
58 timezone : UTC | |
59 timeformat : yyyy-mm-dd HH:MM:SS.FFF | |
60 time_str : 2008-03-30 19:09:59.919 | |
61 | |
62 created : 2008-03-30 19:09:59.919 | |
63 version : $Id: time.m,v 1.33 2008/03/27 13:59:06 mauro Exp | |
64 plist : | |
65 ----------------------------- | |
66 </pre></div> | |
67 | |
68 <!-- --------------- NEXT EXAMPLE --------------- --> | |
69 | |
70 <hr> | |
71 <h2 class="title"><a name="xml_file"></a>Construct a TIME object by loading the object from a file</h2> | |
72 <p>The following example creates a new time object by loading the time object from disk.</p> | |
73 <div class="fragment"><pre class="programlisting"> | |
74 t = time(<span class="string">'time.mat'</span>) | |
75 t = time(<span class="string">'time.xml'</span>) | |
76 </pre></div> | |
77 | |
78 <!-- --------------- NEXT EXAMPLE --------------- --> | |
79 | |
80 <hr> | |
81 <h2 class="title"><a name="string"></a>Construct a TIME object from a string</h2> | |
82 <p>Create a time object with different string formats.</p> | |
83 <div class="fragment"><pre class="programlisting"> | |
84 t1 = time(<span class="string">'14:00:00'</span>) <span class="comment">% HH:MM:SS</span> | |
85 t1 = time(<span class="string">'14:00:00.123'</span>) <span class="comment">% HH:MM:SS.FFF</span> | |
86 t2 = time(<span class="string">'2008.04.01 17:00:00'</span>) <span class="comment">% yyyy.mm.dd. HH:MM:SS</span> | |
87 t3 = time(<span class="string">'17:00:00 2008.04.01'</span>) <span class="comment">% HH:MM:SS yyyy.mm.dd</span> | |
88 t4 = time(<span class="string">'17:00:00 2008-04-01'</span>) <span class="comment">% HH:MM:SS yyyy-mm-dd</span> | |
89 </pre></div> | |
90 <p>You can combine the following string formats: | |
91 <ul> | |
92 <li>HH:MM:SS</li> | |
93 <li>MM:SS</li> | |
94 <li>dd-mm-yyyy</li> | |
95 <li>dd.mm.yyyy</li> | |
96 <li>yyyy-mm-dd</li> | |
97 <li>yyyy.mm.dd</li> | |
98 <li>mm-dd</li> | |
99 <li>.fff</li> | |
100 </ul> | |
101 </p> | |
102 | |
103 <!-- --------------- NEXT EXAMPLE --------------- --> | |
104 | |
105 <hr> | |
106 <h2 class="title"><a name="string_format"></a>Construct a TIME object from a string and time format</h2> | |
107 <p>Create a time object with different string formats and a time format. The time format is either a MATLAB format string or a MATLAB format number.</p> | |
108 <div class="fragment"><pre class="programlisting"> | |
109 t1 = time(<span class="string">'14:00:00'</span>, <span class="string">'HH:MM:SS'</span>) | |
110 t2 = time(<span class="string">'14:00:00'</span>, <span class="string">'yyyy.mm.dd HH:MM:SS'</span>) | |
111 t3 = time(<span class="string">'14:00:00'</span>, 31) | |
112 t4 = time(<span class="string">'14:00:00'</span>, 17) | |
113 </pre></div> | |
114 | |
115 <!-- --------------- NEXT EXAMPLE --------------- --> | |
116 | |
117 <hr> | |
118 <h2 class="title"><a name="epoch"></a>Construct a TIME object from the unix epoch time</h2> | |
119 <p>Create a time objrct from the unix epoch time. The epoch time starts from '1970-01-01 00:00:00.000'<br />Remark: the epoch time must be in milliseconds</p> | |
120 <div class="fragment"><pre class="programlisting"> | |
121 t1 = time(0) | |
122 t2 = time(1206900000000) <span class="comment">% 2008-03-30 18:00:00</span> | |
123 </pre></div> | |
124 | |
125 | |
126 <!-- --------------- NEXT EXAMPLE --------------- --> | |
127 | |
128 <hr> | |
129 <h2 class="title"><a name="plist"></a>Construct a TIME object from a parameter list (PLIST) object</h2> | |
130 <p></p> | |
131 | |
132 <!-- --------------- key-word 'utc_epoch_milli' --------------- --> | |
133 | |
134 <h3 class="title"><a name="utc_epoch_milli"></a>Use the key word 'utc_epoch_milli'</h3> | |
135 <p>Construct a TIME by its properties definition | |
136 <table border="0" summary="Simple list" class="simplelist_nottable_last" width="50%"> | |
137 <tr valign="top"> | |
138 <td width="25%"> | |
139 <p>'utc_epoch_milli'</p> | |
140 </td> | |
141 <td width="75%"> | |
142 <p>The time in milliseconds [default: 0]</p> | |
143 </td> | |
144 </tr> | |
145 </table> | |
146 </p> | |
147 <p>Additional parameters: | |
148 <table border="0" summary="Simple list" class="simplelist_nottable_last" width="50%"> | |
149 <tr valign="top"> | |
150 <td width="25%"> | |
151 <p>'timezone'</p> | |
152 </td> | |
153 <td width="75%"> | |
154 <p>Timezone (string or java object) [default: 'UTC']</p> | |
155 </td> | |
156 </tr> | |
157 <tr valign="top"> | |
158 <td width="25%"> | |
159 <p>'timeformat'</p> | |
160 </td> | |
161 <td width="75%"> | |
162 <p>Time format (string)<br />[default: 'yyyy-mm-dd HH:MM:SS.FFF']</p> | |
163 </td> | |
164 </tr> | |
165 </table> | |
166 </p> | |
167 | |
168 <div class="fragment"><pre class="programlisting"> | |
169 pl1 = plist(<span class="string">'utc_epoch_milli'</span>, 1206900000000); | |
170 pl2 = plist(<span class="string">'utc_epoch_milli'<span class="string">, 1206900000000, ... | |
171 <span class="string">'timeformat'<span class="string">, <span class="string">'HH:MM:SS'<span class="string">, ... | |
172 <span class="string">'timezone'<span class="string">, <span class="string">'CET'<span class="string">); | |
173 | |
174 t1 = time(pl1) | |
175 t2 = time(pl2) | |
176 </pre></div> | |
177 | |
178 <!-- --------------- key-word 'time_str' --------------- --> | |
179 | |
180 <h3 class="title"><a name="time_str"></a>Use the key word 'time_str'</h3> | |
181 <p>Construct a TIME by its properties definition | |
182 <table border="0" summary="Simple list" class="simplelist_nottable_last" width="50%"> | |
183 <tr valign="top"> | |
184 <td width="25%"> | |
185 <p>'time_str'</p> | |
186 </td> | |
187 <td width="75%"> | |
188 <p>the time string [default: '1970-01-01 00:00:00.000']</p> | |
189 </td> | |
190 </tr> | |
191 </table> | |
192 </p> | |
193 <p>Additional parameters: | |
194 <table border="0" summary="Simple list" class="simplelist_nottable_last" width="50%"> | |
195 <tr valign="top"> | |
196 <td width="25%"> | |
197 <p>'timezone'</p> | |
198 </td> | |
199 <td width="75%"> | |
200 <p>Timezone (string or java object) [default: 'UTC']</p> | |
201 </td> | |
202 </tr> | |
203 <tr valign="top"> | |
204 <td width="25%"> | |
205 <p>'timeformat'</p> | |
206 </td> | |
207 <td width="75%"> | |
208 <p>Time format (string)<br />[default: 'yyyy-mm-dd HH:MM:SS.FFF']</p> | |
209 </td> | |
210 </tr> | |
211 </table> | |
212 </p> | |
213 | |
214 <div class="fragment"><pre class="programlisting"> | |
215 pl1 = plist(<span class="string">'time_str'</span>, <span class="string">'14:00:00 15.01.2008'</span>); | |
216 pl2 = plist(<span class="string">'time_str'</span>, <span class="string">'14:00:00 15.01.2008'</span>, ... | |
217 <span class="string">'timeformat'</span>, <span class="string">'HH:MM:SS'</span>, ... | |
218 <span class="string">'timezone'</span>, <span class="string">'CET'</span>); | |
219 | |
220 t1 = time(pl1) | |
221 t2 = time(pl2) | |
222 </pre></div> | |
223 | |
224 <!-- ------------------------------------------------ --> | |
225 <!-- --------------- END CONTENT FILE --------------- --> | |
226 <!-- ------------------------------------------------ --> |