a whole bunch of stuff
[ephemerata.git] / Toady / lib / commons-lang-2.4 / apidocs / org / apache / commons / lang / time / DurationFormatUtils.html
blobf99be2587babc98ddd52fc2b12507393774e4e51
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
5 <!-- Generated by javadoc (build 1.4.2_16) on Sat Mar 15 20:43:48 PDT 2008 -->
6 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
7 <TITLE>
8 DurationFormatUtils (Commons Lang 2.4 API)
9 </TITLE>
11 <META NAME="keywords" CONTENT="org.apache.commons.lang.time.DurationFormatUtils class">
13 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
15 <SCRIPT type="text/javascript">
16 function windowTitle()
18 parent.document.title="DurationFormatUtils (Commons Lang 2.4 API)";
20 </SCRIPT>
22 </HEAD>
24 <BODY BGCOLOR="white" onload="windowTitle();">
27 <!-- ========= START OF TOP NAVBAR ======= -->
28 <A NAME="navbar_top"><!-- --></A>
29 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
30 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
31 <TR>
32 <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
33 <A NAME="navbar_top_firstrow"><!-- --></A>
34 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
35 <TR ALIGN="center" VALIGN="top">
36 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
37 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
38 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
39 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DurationFormatUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
44 </TR>
45 </TABLE>
46 </TD>
47 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
48 </EM>
49 </TD>
50 </TR>
52 <TR>
53 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
54 &nbsp;<A HREF="../../../../../org/apache/commons/lang/time/DateUtils.html" title="class in org.apache.commons.lang.time"><B>PREV CLASS</B></A>&nbsp;
55 &nbsp;<A HREF="../../../../../org/apache/commons/lang/time/FastDateFormat.html" title="class in org.apache.commons.lang.time"><B>NEXT CLASS</B></A></FONT></TD>
56 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57 <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
58 &nbsp;<A HREF="DurationFormatUtils.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
59 &nbsp;<SCRIPT type="text/javascript">
60 <!--
61 if(window==top) {
62 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
64 //-->
65 </SCRIPT>
66 <NOSCRIPT>
67 <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
68 </NOSCRIPT>
70 </FONT></TD>
71 </TR>
72 <TR>
73 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
74 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
75 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
76 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
77 </TR>
78 </TABLE>
79 <A NAME="skip-navbar_top"></A>
80 <!-- ========= END OF TOP NAVBAR ========= -->
82 <HR>
83 <!-- ======== START OF CLASS DATA ======== -->
84 <H2>
85 <FONT SIZE="-1">
86 org.apache.commons.lang.time</FONT>
87 <BR>
88 Class DurationFormatUtils</H2>
89 <PRE>
90 java.lang.Object
91 <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><B>org.apache.commons.lang.time.DurationFormatUtils</B>
92 </PRE>
93 <HR>
94 <DL>
95 <DT>public class <B>DurationFormatUtils</B><DT>extends java.lang.Object</DL>
97 <P>
98 <p>Duration formatting utilities and constants. The following table describes the tokens
99 used in the pattern language for formatting. </p>
100 <table border="1">
101 <tr><th>character</th><th>duration element</th></tr>
102 <tr><td>y</td><td>years</td></tr>
103 <tr><td>M</td><td>months</td></tr>
104 <tr><td>d</td><td>days</td></tr>
105 <tr><td>H</td><td>hours</td></tr>
106 <tr><td>m</td><td>minutes</td></tr>
107 <tr><td>s</td><td>seconds</td></tr>
108 <tr><td>S</td><td>milliseconds</td></tr>
109 </table>
113 <DL>
114 <DT><B>Since:</B></DT>
115 <DD>2.1</DD>
116 <DT><B>Version:</B></DT>
117 <DD>$Id: DurationFormatUtils.java 583666 2007-10-11 01:38:13Z ggregory $</DD>
118 <DT><B>Author:</B></DT>
119 <DD>Apache Ant - DateUtils, <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a>, <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>, Stephen Colebourne, <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a></DD>
120 </DL>
121 <HR>
124 <!-- ======== NESTED CLASS SUMMARY ======== -->
127 <!-- =========== FIELD SUMMARY =========== -->
129 <A NAME="field_summary"><!-- --></A>
130 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
131 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
132 <TD COLSPAN=2><FONT SIZE="+2">
133 <B>Field Summary</B></FONT></TD>
134 </TR>
135 <TR BGCOLOR="white" CLASS="TableRowColor">
136 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
137 <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
138 <TD><CODE><B><A HREF="../../../../../org/apache/commons/lang/time/DurationFormatUtils.html#ISO_EXTENDED_FORMAT_PATTERN">ISO_EXTENDED_FORMAT_PATTERN</A></B></CODE>
140 <BR>
141 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pattern used with <code>FastDateFormat</code> and <code>SimpleDateFormat</code>
142 for the ISO8601 period format used in durations.</TD>
143 </TR>
144 </TABLE>
145 &nbsp;
146 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
148 <A NAME="constructor_summary"><!-- --></A>
149 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
150 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
151 <TD COLSPAN=2><FONT SIZE="+2">
152 <B>Constructor Summary</B></FONT></TD>
153 </TR>
154 <TR BGCOLOR="white" CLASS="TableRowColor">
155 <TD><CODE><B><A HREF="../../../../../org/apache/commons/lang/time/DurationFormatUtils.html#DurationFormatUtils()">DurationFormatUtils</A></B>()</CODE>
157 <BR>
158 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DurationFormatUtils instances should NOT be constructed in standard programming.</TD>
159 </TR>
160 </TABLE>
161 &nbsp;
162 <!-- ========== METHOD SUMMARY =========== -->
164 <A NAME="method_summary"><!-- --></A>
165 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
166 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
167 <TD COLSPAN=2><FONT SIZE="+2">
168 <B>Method Summary</B></FONT></TD>
169 </TR>
170 <TR BGCOLOR="white" CLASS="TableRowColor">
171 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
172 <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
173 <TD><CODE><B><A HREF="../../../../../org/apache/commons/lang/time/DurationFormatUtils.html#formatDuration(long, java.lang.String)">formatDuration</A></B>(long&nbsp;durationMillis,
174 java.lang.String&nbsp;format)</CODE>
176 <BR>
177 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats the time gap as a string, using the specified format, and padding with zeros and
178 using the default timezone.</TD>
179 </TR>
180 <TR BGCOLOR="white" CLASS="TableRowColor">
181 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
182 <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
183 <TD><CODE><B><A HREF="../../../../../org/apache/commons/lang/time/DurationFormatUtils.html#formatDuration(long, java.lang.String, boolean)">formatDuration</A></B>(long&nbsp;durationMillis,
184 java.lang.String&nbsp;format,
185 boolean&nbsp;padWithZeros)</CODE>
187 <BR>
188 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats the time gap as a string, using the specified format.</TD>
189 </TR>
190 <TR BGCOLOR="white" CLASS="TableRowColor">
191 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
192 <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
193 <TD><CODE><B><A HREF="../../../../../org/apache/commons/lang/time/DurationFormatUtils.html#formatDurationHMS(long)">formatDurationHMS</A></B>(long&nbsp;durationMillis)</CODE>
195 <BR>
196 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats the time gap as a string.</TD>
197 </TR>
198 <TR BGCOLOR="white" CLASS="TableRowColor">
199 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
200 <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
201 <TD><CODE><B><A HREF="../../../../../org/apache/commons/lang/time/DurationFormatUtils.html#formatDurationISO(long)">formatDurationISO</A></B>(long&nbsp;durationMillis)</CODE>
203 <BR>
204 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats the time gap as a string.</TD>
205 </TR>
206 <TR BGCOLOR="white" CLASS="TableRowColor">
207 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
208 <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
209 <TD><CODE><B><A HREF="../../../../../org/apache/commons/lang/time/DurationFormatUtils.html#formatDurationWords(long, boolean, boolean)">formatDurationWords</A></B>(long&nbsp;durationMillis,
210 boolean&nbsp;suppressLeadingZeroElements,
211 boolean&nbsp;suppressTrailingZeroElements)</CODE>
213 <BR>
214 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats an elapsed time into a plurialization correct string.</TD>
215 </TR>
216 <TR BGCOLOR="white" CLASS="TableRowColor">
217 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
218 <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
219 <TD><CODE><B><A HREF="../../../../../org/apache/commons/lang/time/DurationFormatUtils.html#formatPeriod(long, long, java.lang.String)">formatPeriod</A></B>(long&nbsp;startMillis,
220 long&nbsp;endMillis,
221 java.lang.String&nbsp;format)</CODE>
223 <BR>
224 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats the time gap as a string, using the specified format.</TD>
225 </TR>
226 <TR BGCOLOR="white" CLASS="TableRowColor">
227 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
228 <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
229 <TD><CODE><B><A HREF="../../../../../org/apache/commons/lang/time/DurationFormatUtils.html#formatPeriod(long, long, java.lang.String, boolean, java.util.TimeZone)">formatPeriod</A></B>(long&nbsp;startMillis,
230 long&nbsp;endMillis,
231 java.lang.String&nbsp;format,
232 boolean&nbsp;padWithZeros,
233 java.util.TimeZone&nbsp;timezone)</CODE>
235 <BR>
236 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats the time gap as a string, using the specified format.</TD>
237 </TR>
238 <TR BGCOLOR="white" CLASS="TableRowColor">
239 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
240 <CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
241 <TD><CODE><B><A HREF="../../../../../org/apache/commons/lang/time/DurationFormatUtils.html#formatPeriodISO(long, long)">formatPeriodISO</A></B>(long&nbsp;startMillis,
242 long&nbsp;endMillis)</CODE>
244 <BR>
245 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Formats the time gap as a string.</TD>
246 </TR>
247 </TABLE>
248 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
249 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
250 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
251 <TD><B>Methods inherited from class java.lang.Object</B></TD>
252 </TR>
253 <TR BGCOLOR="white" CLASS="TableRowColor">
254 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
255 </TR>
256 </TABLE>
257 &nbsp;
260 <!-- ============ FIELD DETAIL =========== -->
262 <A NAME="field_detail"><!-- --></A>
263 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
264 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
265 <TD COLSPAN=1><FONT SIZE="+2">
266 <B>Field Detail</B></FONT></TD>
267 </TR>
268 </TABLE>
270 <A NAME="ISO_EXTENDED_FORMAT_PATTERN"><!-- --></A><H3>
271 ISO_EXTENDED_FORMAT_PATTERN</H3>
272 <PRE>
273 public static final java.lang.String <B>ISO_EXTENDED_FORMAT_PATTERN</B></PRE>
274 <DL>
275 <DD><p>Pattern used with <code>FastDateFormat</code> and <code>SimpleDateFormat</code>
276 for the ISO8601 period format used in durations.</p>
278 <DL>
279 <DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/lang/time/FastDateFormat.html" title="class in org.apache.commons.lang.time"><CODE>FastDateFormat</CODE></A>,
280 <CODE>SimpleDateFormat</CODE>,
281 <A HREF="../../../../../constant-values.html#org.apache.commons.lang.time.DurationFormatUtils.ISO_EXTENDED_FORMAT_PATTERN">Constant Field Values</A></DL>
282 </DL>
284 <!-- ========= CONSTRUCTOR DETAIL ======== -->
286 <A NAME="constructor_detail"><!-- --></A>
287 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
288 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
289 <TD COLSPAN=1><FONT SIZE="+2">
290 <B>Constructor Detail</B></FONT></TD>
291 </TR>
292 </TABLE>
294 <A NAME="DurationFormatUtils()"><!-- --></A><H3>
295 DurationFormatUtils</H3>
296 <PRE>
297 public <B>DurationFormatUtils</B>()</PRE>
298 <DL>
299 <DD><p>DurationFormatUtils instances should NOT be constructed in standard programming.</p>
301 <p>This constructor is public to permit tools that require a JavaBean instance
302 to operate.</p>
304 </DL>
306 <!-- ============ METHOD DETAIL ========== -->
308 <A NAME="method_detail"><!-- --></A>
309 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
310 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
311 <TD COLSPAN=1><FONT SIZE="+2">
312 <B>Method Detail</B></FONT></TD>
313 </TR>
314 </TABLE>
316 <A NAME="formatDurationHMS(long)"><!-- --></A><H3>
317 formatDurationHMS</H3>
318 <PRE>
319 public static java.lang.String <B>formatDurationHMS</B>(long&nbsp;durationMillis)</PRE>
320 <DL>
321 <DD><p>Formats the time gap as a string.</p>
323 <p>The format used is ISO8601-like:
324 <i>H</i>:<i>m</i>:<i>s</i>.<i>S</i>.</p>
326 <DD><DL>
327 <DT><B>Parameters:</B><DD><CODE>durationMillis</CODE> - the duration to format
328 <DT><B>Returns:</B><DD>the time as a String</DL>
329 </DD>
330 </DL>
331 <HR>
333 <A NAME="formatDurationISO(long)"><!-- --></A><H3>
334 formatDurationISO</H3>
335 <PRE>
336 public static java.lang.String <B>formatDurationISO</B>(long&nbsp;durationMillis)</PRE>
337 <DL>
338 <DD><p>Formats the time gap as a string.</p>
340 <p>The format used is the ISO8601 period format.</p>
342 <p>This method formats durations using the days and lower fields of the
343 ISO format pattern, such as P7D6TH5M4.321S.</p>
345 <DD><DL>
346 <DT><B>Parameters:</B><DD><CODE>durationMillis</CODE> - the duration to format
347 <DT><B>Returns:</B><DD>the time as a String</DL>
348 </DD>
349 </DL>
350 <HR>
352 <A NAME="formatDuration(long, java.lang.String)"><!-- --></A><H3>
353 formatDuration</H3>
354 <PRE>
355 public static java.lang.String <B>formatDuration</B>(long&nbsp;durationMillis,
356 java.lang.String&nbsp;format)</PRE>
357 <DL>
358 <DD><p>Formats the time gap as a string, using the specified format, and padding with zeros and
359 using the default timezone.</p>
361 <p>This method formats durations using the days and lower fields of the
362 format pattern. Months and larger are not used.</p>
364 <DD><DL>
365 <DT><B>Parameters:</B><DD><CODE>durationMillis</CODE> - the duration to format<DD><CODE>format</CODE> - the way in which to format the duration
366 <DT><B>Returns:</B><DD>the time as a String</DL>
367 </DD>
368 </DL>
369 <HR>
371 <A NAME="formatDuration(long, java.lang.String, boolean)"><!-- --></A><H3>
372 formatDuration</H3>
373 <PRE>
374 public static java.lang.String <B>formatDuration</B>(long&nbsp;durationMillis,
375 java.lang.String&nbsp;format,
376 boolean&nbsp;padWithZeros)</PRE>
377 <DL>
378 <DD><p>Formats the time gap as a string, using the specified format.
379 Padding the left hand side of numbers with zeroes is optional and
380 the timezone may be specified.</p>
382 <p>This method formats durations using the days and lower fields of the
383 format pattern. Months and larger are not used.</p>
385 <DD><DL>
386 <DT><B>Parameters:</B><DD><CODE>durationMillis</CODE> - the duration to format<DD><CODE>format</CODE> - the way in which to format the duration<DD><CODE>padWithZeros</CODE> - whether to pad the left hand side of numbers with 0's
387 <DT><B>Returns:</B><DD>the time as a String</DL>
388 </DD>
389 </DL>
390 <HR>
392 <A NAME="formatDurationWords(long, boolean, boolean)"><!-- --></A><H3>
393 formatDurationWords</H3>
394 <PRE>
395 public static java.lang.String <B>formatDurationWords</B>(long&nbsp;durationMillis,
396 boolean&nbsp;suppressLeadingZeroElements,
397 boolean&nbsp;suppressTrailingZeroElements)</PRE>
398 <DL>
399 <DD><p>Formats an elapsed time into a plurialization correct string.</p>
401 <p>This method formats durations using the days and lower fields of the
402 format pattern. Months and larger are not used.</p>
404 <DD><DL>
405 <DT><B>Parameters:</B><DD><CODE>durationMillis</CODE> - the elapsed time to report in milliseconds<DD><CODE>suppressLeadingZeroElements</CODE> - suppresses leading 0 elements<DD><CODE>suppressTrailingZeroElements</CODE> - suppresses trailing 0 elements
406 <DT><B>Returns:</B><DD>the formatted text in days/hours/minutes/seconds</DL>
407 </DD>
408 </DL>
409 <HR>
411 <A NAME="formatPeriodISO(long, long)"><!-- --></A><H3>
412 formatPeriodISO</H3>
413 <PRE>
414 public static java.lang.String <B>formatPeriodISO</B>(long&nbsp;startMillis,
415 long&nbsp;endMillis)</PRE>
416 <DL>
417 <DD><p>Formats the time gap as a string.</p>
419 <p>The format used is the ISO8601 period format.</p>
421 <DD><DL>
422 <DT><B>Parameters:</B><DD><CODE>startMillis</CODE> - the start of the duration to format<DD><CODE>endMillis</CODE> - the end of the duration to format
423 <DT><B>Returns:</B><DD>the time as a String</DL>
424 </DD>
425 </DL>
426 <HR>
428 <A NAME="formatPeriod(long, long, java.lang.String)"><!-- --></A><H3>
429 formatPeriod</H3>
430 <PRE>
431 public static java.lang.String <B>formatPeriod</B>(long&nbsp;startMillis,
432 long&nbsp;endMillis,
433 java.lang.String&nbsp;format)</PRE>
434 <DL>
435 <DD><p>Formats the time gap as a string, using the specified format.
436 Padding the left hand side of numbers with zeroes is optional.
438 <DD><DL>
439 <DT><B>Parameters:</B><DD><CODE>startMillis</CODE> - the start of the duration<DD><CODE>endMillis</CODE> - the end of the duration<DD><CODE>format</CODE> - the way in which to format the duration
440 <DT><B>Returns:</B><DD>the time as a String</DL>
441 </DD>
442 </DL>
443 <HR>
445 <A NAME="formatPeriod(long, long, java.lang.String, boolean, java.util.TimeZone)"><!-- --></A><H3>
446 formatPeriod</H3>
447 <PRE>
448 public static java.lang.String <B>formatPeriod</B>(long&nbsp;startMillis,
449 long&nbsp;endMillis,
450 java.lang.String&nbsp;format,
451 boolean&nbsp;padWithZeros,
452 java.util.TimeZone&nbsp;timezone)</PRE>
453 <DL>
454 <DD><p>Formats the time gap as a string, using the specified format.
455 Padding the left hand side of numbers with zeroes is optional and
456 the timezone may be specified. </p>
458 <p>When calculating the difference between months/days, it chooses to
459 calculate months first. So when working out the number of months and
460 days between January 15th and March 10th, it choose 1 month and
461 23 days gained by choosing January->February = 1 month and then
462 calculating days forwards, and not the 1 month and 26 days gained by
463 choosing March -> February = 1 month and then calculating days
464 backwards. </p>
466 <p>For more control, the <a href="http://joda-time.sf.net/">Joda-Time</a>
467 library is recommended.</p>
469 <DD><DL>
470 <DT><B>Parameters:</B><DD><CODE>startMillis</CODE> - the start of the duration<DD><CODE>endMillis</CODE> - the end of the duration<DD><CODE>format</CODE> - the way in which to format the duration<DD><CODE>padWithZeros</CODE> - whether to pad the left hand side of numbers with 0's<DD><CODE>timezone</CODE> - the millis are defined in
471 <DT><B>Returns:</B><DD>the time as a String</DL>
472 </DD>
473 </DL>
474 <!-- ========= END OF CLASS DATA ========= -->
475 <HR>
478 <!-- ======= START OF BOTTOM NAVBAR ====== -->
479 <A NAME="navbar_bottom"><!-- --></A>
480 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
481 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
482 <TR>
483 <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
484 <A NAME="navbar_bottom_firstrow"><!-- --></A>
485 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
486 <TR ALIGN="center" VALIGN="top">
487 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
488 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
489 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
490 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DurationFormatUtils.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
491 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
492 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
493 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
494 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
495 </TR>
496 </TABLE>
497 </TD>
498 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
499 </EM>
500 </TD>
501 </TR>
503 <TR>
504 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
505 &nbsp;<A HREF="../../../../../org/apache/commons/lang/time/DateUtils.html" title="class in org.apache.commons.lang.time"><B>PREV CLASS</B></A>&nbsp;
506 &nbsp;<A HREF="../../../../../org/apache/commons/lang/time/FastDateFormat.html" title="class in org.apache.commons.lang.time"><B>NEXT CLASS</B></A></FONT></TD>
507 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
508 <A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp;
509 &nbsp;<A HREF="DurationFormatUtils.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
510 &nbsp;<SCRIPT type="text/javascript">
511 <!--
512 if(window==top) {
513 document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
515 //-->
516 </SCRIPT>
517 <NOSCRIPT>
518 <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
519 </NOSCRIPT>
521 </FONT></TD>
522 </TR>
523 <TR>
524 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
525 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
526 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
527 DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
528 </TR>
529 </TABLE>
530 <A NAME="skip-navbar_bottom"></A>
531 <!-- ======== END OF BOTTOM NAVBAR ======= -->
533 <HR>
534 Copyright © 2001-2008 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
535 </BODY>
536 </HTML>