Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates > by-pkgid > 6be1bc83fe66bfd1cc77e80ea06f2bae > files > 239

icu-doc-53.1-12.3.mga5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>ICU 53.1: icu::RelativeDateTimeFormatter Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">ICU 53.1
   &#160;<span id="projectnumber">53.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&#160;Structure&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(11)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(12)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceicu.html">icu</a></li><li class="navelem"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html">RelativeDateTimeFormatter</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">icu::RelativeDateTimeFormatter Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Formats simple relative dates.  
 <a href="classicu_1_1RelativeDateTimeFormatter.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="reldatefmt_8h_source.html">reldatefmt.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for icu::RelativeDateTimeFormatter:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classicu_1_1RelativeDateTimeFormatter.png" usemap="#icu::RelativeDateTimeFormatter_map" alt=""/>
  <map id="icu::RelativeDateTimeFormatter_map" name="icu::RelativeDateTimeFormatter_map">
<area href="classicu_1_1UObject.html" title="UObject is the common ICU &quot;boilerplate&quot; class. " alt="icu::UObject" shape="rect" coords="0,56,186,80"/>
<area href="classicu_1_1UMemory.html" title="UMemory is the common ICU base class. " alt="icu::UMemory" shape="rect" coords="0,0,186,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3d851dac0b614cb790547fad33e3ee33"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html#a3d851dac0b614cb790547fad33e3ee33">RelativeDateTimeFormatter</a> (<a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status)</td></tr>
<tr class="memdesc:a3d851dac0b614cb790547fad33e3ee33"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create <a class="el" href="classicu_1_1RelativeDateTimeFormatter.html" title="Formats simple relative dates. ">RelativeDateTimeFormatter</a> with default locale.  <a href="#a3d851dac0b614cb790547fad33e3ee33">More...</a><br/></td></tr>
<tr class="separator:a3d851dac0b614cb790547fad33e3ee33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3cf7e87440adcdc028b7cb1807bbc60"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html#ae3cf7e87440adcdc028b7cb1807bbc60">RelativeDateTimeFormatter</a> (const <a class="el" href="classicu_1_1Locale.html">Locale</a> &amp;locale, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status)</td></tr>
<tr class="memdesc:ae3cf7e87440adcdc028b7cb1807bbc60"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create <a class="el" href="classicu_1_1RelativeDateTimeFormatter.html" title="Formats simple relative dates. ">RelativeDateTimeFormatter</a> with given locale.  <a href="#ae3cf7e87440adcdc028b7cb1807bbc60">More...</a><br/></td></tr>
<tr class="separator:ae3cf7e87440adcdc028b7cb1807bbc60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6161f2631ed48c9151e5d312615a42a4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html#a6161f2631ed48c9151e5d312615a42a4">RelativeDateTimeFormatter</a> (const <a class="el" href="classicu_1_1Locale.html">Locale</a> &amp;locale, <a class="el" href="classicu_1_1NumberFormat.html">NumberFormat</a> *nfToAdopt, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status)</td></tr>
<tr class="memdesc:a6161f2631ed48c9151e5d312615a42a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create <a class="el" href="classicu_1_1RelativeDateTimeFormatter.html" title="Formats simple relative dates. ">RelativeDateTimeFormatter</a> with given locale and <a class="el" href="classicu_1_1NumberFormat.html" title="Abstract base class for all number formats. ">NumberFormat</a>.  <a href="#a6161f2631ed48c9151e5d312615a42a4">More...</a><br/></td></tr>
<tr class="separator:a6161f2631ed48c9151e5d312615a42a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78ec674f3fa02ccfb8ef135d51aead19"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html#a78ec674f3fa02ccfb8ef135d51aead19">RelativeDateTimeFormatter</a> (const <a class="el" href="classicu_1_1RelativeDateTimeFormatter.html">RelativeDateTimeFormatter</a> &amp;other)</td></tr>
<tr class="memdesc:a78ec674f3fa02ccfb8ef135d51aead19"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor.  <a href="#a78ec674f3fa02ccfb8ef135d51aead19">More...</a><br/></td></tr>
<tr class="separator:a78ec674f3fa02ccfb8ef135d51aead19"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a542b94475d7186dd804438af75d6d7cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html">RelativeDateTimeFormatter</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html#a542b94475d7186dd804438af75d6d7cd">operator=</a> (const <a class="el" href="classicu_1_1RelativeDateTimeFormatter.html">RelativeDateTimeFormatter</a> &amp;other)</td></tr>
<tr class="memdesc:a542b94475d7186dd804438af75d6d7cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator.  <a href="#a542b94475d7186dd804438af75d6d7cd">More...</a><br/></td></tr>
<tr class="separator:a542b94475d7186dd804438af75d6d7cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a01fd3f7c20b36dd799ae21de045d8f1c"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html#a01fd3f7c20b36dd799ae21de045d8f1c">~RelativeDateTimeFormatter</a> ()</td></tr>
<tr class="memdesc:a01fd3f7c20b36dd799ae21de045d8f1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#a01fd3f7c20b36dd799ae21de045d8f1c">More...</a><br/></td></tr>
<tr class="separator:a01fd3f7c20b36dd799ae21de045d8f1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef962ca2edf2a25cdaa119c5b5506a86"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html#aef962ca2edf2a25cdaa119c5b5506a86">format</a> (double quantity, <a class="el" href="reldatefmt_8h.html#af26ab0856c1c3c66c20b3b58a51f6117">UDateDirection</a> direction, <a class="el" href="reldatefmt_8h.html#acef843ce890f170add50c0d08aa0c15a">UDateRelativeUnit</a> unit, <a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;appendTo, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status) const </td></tr>
<tr class="memdesc:aef962ca2edf2a25cdaa119c5b5506a86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Formats a relative date with a quantity such as "in 5 days" or "3 months ago".  <a href="#aef962ca2edf2a25cdaa119c5b5506a86">More...</a><br/></td></tr>
<tr class="separator:aef962ca2edf2a25cdaa119c5b5506a86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7cf748d2d9f9813e2267fe7a70a6186e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html#a7cf748d2d9f9813e2267fe7a70a6186e">format</a> (<a class="el" href="reldatefmt_8h.html#af26ab0856c1c3c66c20b3b58a51f6117">UDateDirection</a> direction, <a class="el" href="reldatefmt_8h.html#a7790f9d3058dac2898cddfc65c3c3b16">UDateAbsoluteUnit</a> unit, <a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;appendTo, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status) const </td></tr>
<tr class="memdesc:a7cf748d2d9f9813e2267fe7a70a6186e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Formats a relative date without a quantity.  <a href="#a7cf748d2d9f9813e2267fe7a70a6186e">More...</a><br/></td></tr>
<tr class="separator:a7cf748d2d9f9813e2267fe7a70a6186e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a33e43ebe1d41213832d8ff3aad7556f5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html#a33e43ebe1d41213832d8ff3aad7556f5">combineDateAndTime</a> (const <a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;relativeDateString, const <a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;timeString, <a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;appendTo, <a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;status) const </td></tr>
<tr class="memdesc:a33e43ebe1d41213832d8ff3aad7556f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combines a relative date string and a time string in this object's locale.  <a href="#a33e43ebe1d41213832d8ff3aad7556f5">More...</a><br/></td></tr>
<tr class="separator:a33e43ebe1d41213832d8ff3aad7556f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad0b97264e57381bcda6c2bc226a2e5d8"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classicu_1_1NumberFormat.html">NumberFormat</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html#ad0b97264e57381bcda6c2bc226a2e5d8">getNumberFormat</a> () const </td></tr>
<tr class="memdesc:ad0b97264e57381bcda6c2bc226a2e5d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the <a class="el" href="classicu_1_1NumberFormat.html" title="Abstract base class for all number formats. ">NumberFormat</a> this object is using.  <a href="#ad0b97264e57381bcda6c2bc226a2e5d8">More...</a><br/></td></tr>
<tr class="separator:ad0b97264e57381bcda6c2bc226a2e5d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classicu_1_1UObject"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classicu_1_1UObject')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classicu_1_1UObject.html">icu::UObject</a></td></tr>
<tr class="memitem:af10026497704f510d3d1f2eff50acb18 inherit pub_methods_classicu_1_1UObject"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1UObject.html#af10026497704f510d3d1f2eff50acb18">~UObject</a> ()</td></tr>
<tr class="memdesc:af10026497704f510d3d1f2eff50acb18 inherit pub_methods_classicu_1_1UObject"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#af10026497704f510d3d1f2eff50acb18">More...</a><br/></td></tr>
<tr class="separator:af10026497704f510d3d1f2eff50acb18 inherit pub_methods_classicu_1_1UObject"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1aa93096e880907080b503ff1fb0f8bc inherit pub_methods_classicu_1_1UObject"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="uobject_8h.html#a22af10545208a455a6e884008df48e9f">UClassID</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classicu_1_1UObject.html#a1aa93096e880907080b503ff1fb0f8bc">getDynamicClassID</a> () const </td></tr>
<tr class="memdesc:a1aa93096e880907080b503ff1fb0f8bc inherit pub_methods_classicu_1_1UObject"><td class="mdescLeft">&#160;</td><td class="mdescRight">ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.  <a href="#a1aa93096e880907080b503ff1fb0f8bc">More...</a><br/></td></tr>
<tr class="separator:a1aa93096e880907080b503ff1fb0f8bc inherit pub_methods_classicu_1_1UObject"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Formats simple relative dates. </p>
<p>There are two types of relative dates that it handles: </p>
<ul>
<li>
relative dates with a quantity e.g "in 5 days" </li>
<li>
relative dates without a quantity e.g "next Tuesday" </li>
</ul>
<p>This API is very basic and is intended to be a building block for more fancy APIs. The caller tells it exactly what to display in a locale independent way. While this class automatically provides the correct plural forms, the grammatical form is otherwise as neutral as possible. It is the caller's responsibility to handle cut-off logic such as deciding between displaying "in 7 days" or "in 1 week." This API supports relative dates involving one single unit. This API does not support relative dates involving compound units, e.g "in 5 days and 4 hours" nor does it support parsing. </p>
<p>This class is mostly thread safe and immutable with the following caveats:</p>
<ol type="1">
<li>The assignment operator violates Immutability. It must not be used concurrently with other operations.</li>
<li>Caller must not hold onto adopted pointers. </li>
</ol>
<p>This class is not intended for public subclassing. </p>
<p>Here are some examples of use: </p>
<blockquote class="doxtable">
<pre>
UErrorCode status = U_ZERO_ERROR;
<a class="el" href="classicu_1_1UnicodeString.html" title="UnicodeString is a string class that stores Unicode characters directly and provides similar function...">UnicodeString</a> appendTo;
<a class="el" href="classicu_1_1RelativeDateTimeFormatter.html" title="Formats simple relative dates. ">RelativeDateTimeFormatter</a> fmt(status);
// Appends "in 1 day"
fmt.format(
    1, UDAT_DIRECTION_NEXT, UDAT_RELATIVE_DAYS, appendTo, status);
// Appends "in 3 days"
fmt.format(
    3, UDAT_DIRECTION_NEXT, UDAT_RELATIVE_DAYS, appendTo, status);
// Appends "3.2 years ago"
fmt.format(
    3.2, UDAT_DIRECTION_LAST, UDAT_RELATIVE_YEARS, appendTo, status);
// Appends "last Sunday"
fmt.format(UDAT_DIRECTION_LAST, UDAT_ABSOLUTE_SUNDAY, appendTo, status);
// Appends "this Sunday"
fmt.format(UDAT_DIRECTION_THIS, UDAT_ABSOLUTE_SUNDAY, appendTo, status);
// Appends "next Sunday"
fmt.format(UDAT_DIRECTION_NEXT, UDAT_ABSOLUTE_SUNDAY, appendTo, status);
// Appends "Sunday"
fmt.format(UDAT_DIRECTION_PLAIN, UDAT_ABSOLUTE_SUNDAY, appendTo, status);</pre><pre>// Appends "yesterday"
fmt.format(UDAT_DIRECTION_LAST, UDAT_ABSOLUTE_DAY, appendTo, status);
// Appends "today"
fmt.format(UDAT_DIRECTION_THIS, UDAT_ABSOLUTE_DAY, appendTo, status);
// Appends "tomorrow"
fmt.format(UDAT_DIRECTION_NEXT, UDAT_ABSOLUTE_DAY, appendTo, status);
// Appends "now"
fmt.format(UDAT_DIRECTION_PLAIN, UDAT_ABSOLUTE_NOW, appendTo, status);</pre><pre></pre> </blockquote>
<p>In the future, we may add more forms, such as abbreviated/short forms (3 secs ago), and relative day periods ("yesterday afternoon"), etc.</p>
<p>The <a class="el" href="classicu_1_1RelativeDateTimeFormatter.html" title="Formats simple relative dates. ">RelativeDateTimeFormatter</a> class is not intended for public subclassing.</p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000135">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 53 </dd></dl>

<p>Definition at line <a class="el" href="reldatefmt_8h_source.html#l00299">299</a> of file <a class="el" href="reldatefmt_8h_source.html">reldatefmt.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a3d851dac0b614cb790547fad33e3ee33"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">icu::RelativeDateTimeFormatter::RelativeDateTimeFormatter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&#160;</td>
          <td class="paramname"><em>status</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create <a class="el" href="classicu_1_1RelativeDateTimeFormatter.html" title="Formats simple relative dates. ">RelativeDateTimeFormatter</a> with default locale. </p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000136">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 53 </dd></dl>

</div>
</div>
<a class="anchor" id="ae3cf7e87440adcdc028b7cb1807bbc60"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">icu::RelativeDateTimeFormatter::RelativeDateTimeFormatter </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classicu_1_1Locale.html">Locale</a> &amp;&#160;</td>
          <td class="paramname"><em>locale</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&#160;</td>
          <td class="paramname"><em>status</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create <a class="el" href="classicu_1_1RelativeDateTimeFormatter.html" title="Formats simple relative dates. ">RelativeDateTimeFormatter</a> with given locale. </p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000137">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 53 </dd></dl>

</div>
</div>
<a class="anchor" id="a6161f2631ed48c9151e5d312615a42a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">icu::RelativeDateTimeFormatter::RelativeDateTimeFormatter </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classicu_1_1Locale.html">Locale</a> &amp;&#160;</td>
          <td class="paramname"><em>locale</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classicu_1_1NumberFormat.html">NumberFormat</a> *&#160;</td>
          <td class="paramname"><em>nfToAdopt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&#160;</td>
          <td class="paramname"><em>status</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create <a class="el" href="classicu_1_1RelativeDateTimeFormatter.html" title="Formats simple relative dates. ">RelativeDateTimeFormatter</a> with given locale and <a class="el" href="classicu_1_1NumberFormat.html" title="Abstract base class for all number formats. ">NumberFormat</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">locale</td><td>the locale </td></tr>
    <tr><td class="paramname">nfToAdopt</td><td>Constructed object takes ownership of this pointer. It is an error for caller to delete this pointer or change its contents after calling this constructor.  Any error is returned here. </td></tr>
  </table>
  </dd>
</dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000138">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 53 </dd></dl>

</div>
</div>
<a class="anchor" id="a78ec674f3fa02ccfb8ef135d51aead19"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">icu::RelativeDateTimeFormatter::RelativeDateTimeFormatter </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classicu_1_1RelativeDateTimeFormatter.html">RelativeDateTimeFormatter</a> &amp;&#160;</td>
          <td class="paramname"><em>other</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Copy constructor. </p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000139">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 53 </dd></dl>

</div>
</div>
<a class="anchor" id="a01fd3f7c20b36dd799ae21de045d8f1c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual icu::RelativeDateTimeFormatter::~RelativeDateTimeFormatter </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Destructor. </p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000141">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 53 </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a33e43ebe1d41213832d8ff3aad7556f5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a>&amp; icu::RelativeDateTimeFormatter::combineDateAndTime </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;&#160;</td>
          <td class="paramname"><em>relativeDateString</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;&#160;</td>
          <td class="paramname"><em>timeString</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;&#160;</td>
          <td class="paramname"><em>appendTo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&#160;</td>
          <td class="paramname"><em>status</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Combines a relative date string and a time string in this object's locale. </p>
<p>This is done with the same date-time separator used for the default calendar in this locale.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">relativeDateString</td><td>the relative date, e.g 'yesterday' </td></tr>
    <tr><td class="paramname">timeString</td><td>the time e.g '3:45' </td></tr>
    <tr><td class="paramname">appendTo</td><td>concatenated date and time appended here </td></tr>
    <tr><td class="paramname">status</td><td>ICU error code returned here. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>appendTo </dd></dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000144">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 53 </dd></dl>

</div>
</div>
<a class="anchor" id="aef962ca2edf2a25cdaa119c5b5506a86"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a>&amp; icu::RelativeDateTimeFormatter::format </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>quantity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="reldatefmt_8h.html#af26ab0856c1c3c66c20b3b58a51f6117">UDateDirection</a>&#160;</td>
          <td class="paramname"><em>direction</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="reldatefmt_8h.html#acef843ce890f170add50c0d08aa0c15a">UDateRelativeUnit</a>&#160;</td>
          <td class="paramname"><em>unit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;&#160;</td>
          <td class="paramname"><em>appendTo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&#160;</td>
          <td class="paramname"><em>status</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Formats a relative date with a quantity such as "in 5 days" or "3 months ago". </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">quantity</td><td>The numerical amount e.g 5. This value is formatted according to this object's <a class="el" href="classicu_1_1NumberFormat.html" title="Abstract base class for all number formats. ">NumberFormat</a> object. </td></tr>
    <tr><td class="paramname">direction</td><td>NEXT means a future relative date; LAST means a past relative date. If direction is anything else, this method sets status to U_ILLEGAL_ARGUMENT_ERROR. </td></tr>
    <tr><td class="paramname">unit</td><td>the unit e.g day? month? year? </td></tr>
    <tr><td class="paramname">appendTo</td><td>The string to which the formatted result will be appended </td></tr>
    <tr><td class="paramname">status</td><td>ICU error code returned here. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>appendTo </dd></dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000142">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 53 </dd></dl>

</div>
</div>
<a class="anchor" id="a7cf748d2d9f9813e2267fe7a70a6186e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a>&amp; icu::RelativeDateTimeFormatter::format </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="reldatefmt_8h.html#af26ab0856c1c3c66c20b3b58a51f6117">UDateDirection</a>&#160;</td>
          <td class="paramname"><em>direction</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="reldatefmt_8h.html#a7790f9d3058dac2898cddfc65c3c3b16">UDateAbsoluteUnit</a>&#160;</td>
          <td class="paramname"><em>unit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classicu_1_1UnicodeString.html">UnicodeString</a> &amp;&#160;</td>
          <td class="paramname"><em>appendTo</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> &amp;&#160;</td>
          <td class="paramname"><em>status</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Formats a relative date without a quantity. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">direction</td><td>NEXT, LAST, THIS, etc. </td></tr>
    <tr><td class="paramname">unit</td><td>e.g SATURDAY, DAY, MONTH </td></tr>
    <tr><td class="paramname">appendTo</td><td>The string to which the formatted result will be appended. If the value of direction is documented as not being fully supported in all locales then this method leaves appendTo unchanged if no format string is available. </td></tr>
    <tr><td class="paramname">status</td><td>ICU error code returned here. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>appendTo </dd></dl>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000143">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 53 </dd></dl>

</div>
</div>
<a class="anchor" id="ad0b97264e57381bcda6c2bc226a2e5d8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classicu_1_1NumberFormat.html">NumberFormat</a>&amp; icu::RelativeDateTimeFormatter::getNumberFormat </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the <a class="el" href="classicu_1_1NumberFormat.html" title="Abstract base class for all number formats. ">NumberFormat</a> this object is using. </p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000145">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 53 </dd></dl>

</div>
</div>
<a class="anchor" id="a542b94475d7186dd804438af75d6d7cd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classicu_1_1RelativeDateTimeFormatter.html">RelativeDateTimeFormatter</a>&amp; icu::RelativeDateTimeFormatter::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classicu_1_1RelativeDateTimeFormatter.html">RelativeDateTimeFormatter</a> &amp;&#160;</td>
          <td class="paramname"><em>other</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Assignment operator. </p>
<dl class="draft"><dt><b><a class="el" href="draft.html#_draft000140">Draft:</a></b></dt><dd>This API may be changed in the future versions and was introduced in ICU 53 </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="reldatefmt_8h_source.html">reldatefmt.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>