You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by th...@apache.org on 2012/11/20 04:25:06 UTC

svn commit: r1411522 - in /pig/trunk: CHANGES.txt src/docs/src/documentation/content/xdocs/basic.xml src/docs/src/documentation/content/xdocs/func.xml

Author: thejas
Date: Tue Nov 20 03:25:05 2012
New Revision: 1411522

URL: http://svn.apache.org/viewvc?rev=1411522&view=rev
Log:
PIG-2980: documentation for DateTime datatype (zjshen via thejas)

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/src/docs/src/documentation/content/xdocs/basic.xml
    pig/trunk/src/docs/src/documentation/content/xdocs/func.xml

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1411522&r1=1411521&r2=1411522&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Tue Nov 20 03:25:05 2012
@@ -78,6 +78,8 @@ PIG-1891 Enable StoreFunc to make intell
 
 IMPROVEMENTS
 
+PIG-2980: documentation for DateTime datatype (zjshen via thejas)
+
 PIG-2982: add unit tests for DateTime type that test setting timezone (zjshen via thejas)
 
 PIG-2937: generated field in nested foreach does not inherit the variable name as the field name (jcoveney)

Modified: pig/trunk/src/docs/src/documentation/content/xdocs/basic.xml
URL: http://svn.apache.org/viewvc/pig/trunk/src/docs/src/documentation/content/xdocs/basic.xml?rev=1411522&r1=1411521&r2=1411522&view=diff
==============================================================================
--- pig/trunk/src/docs/src/documentation/content/xdocs/basic.xml (original)
+++ pig/trunk/src/docs/src/documentation/content/xdocs/basic.xml Tue Nov 20 03:25:05 2012
@@ -147,7 +147,7 @@
          
          <tr>
             <td> <p>-- D </p> </td>
-            <td> <p>%declare, %default, define, desc, describe, DIFF, distinct, double, du, dump</p> </td>
+            <td> <p>datetime, %declare, %default, define, desc, describe, DIFF, distinct, double, du, dump</p> </td>
          </tr>  
          
          <tr>
@@ -601,6 +601,17 @@ DUMP X;
          </tr>
          <tr>
             <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>1970-01-01T00:00:00.000+00:00</p>
+            </td>
+         </tr>
+         <tr>
+            <td>
                <p><strong>Complex Types</strong></p>
             </td>
             <td>
@@ -1356,6 +1367,10 @@ dump X;
       <li>
          <p>Any numeric constant with decimal point (for example, 1.5) and/or exponent (for example, 5e+1) is treated as double unless it ends with f or F in which case it is assigned type float (for example,  1.5f). </p>
       </li>
+      <li>
+         <p>There is no native constant type for datetime field. You can use a ToDate udf with chararray constant as argument to generate a datetime value. </p>
+      </li>
+
    </ul>
    <p></p>
    <p>The data type definitions for tuples, bags, and maps apply to constants:</p>
@@ -1631,7 +1646,7 @@ X = FOREACH A GENERATE f1 as user, f2 as
      <!-- ++++++++++++++++++++++++++++++++++ -->  
    <section  id="schema-simple">
    <title>Schemas for Simple Data Types</title>
-   <p>Simple data types include int, long, float, double, chararray, bytearray, and boolean.</p>
+   <p>Simple data types include int, long, float, double, chararray, bytearray, boolean and datetime.</p>
    
    <section>
    <title>Syntax</title>
@@ -3680,6 +3695,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>boolean </p>
             </td>
+            <td>
+               <p>datetime </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -3715,6 +3733,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -3751,6 +3772,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -3787,6 +3811,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -3822,6 +3849,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -3857,6 +3887,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
              <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -3892,6 +3925,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
              <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -3927,6 +3963,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -3962,6 +4001,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -3997,8 +4039,11 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
-                  <tr>
+         <tr>
             <td>
                <p>boolean </p>
             </td>
@@ -4032,6 +4077,47 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>boolean </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
+         </tr>
+         <tr>
+            <td>
+               <p>datetime </p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p>boolean</p>
+            </td>
          </tr>
    </table>
    <p>Note 1: boolean (Tuple A is equal to tuple B if they have the same size s, and for all 0 &lt;= i &lt; s A[i] == B[i])</p>
@@ -4076,6 +4162,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>boolean </p>
             </td>
+            <td>
+               <p>datetime </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -4108,7 +4197,10 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
-          <td>
+            <td>
+               <p>error </p>
+            </td>
+            <td>
                <p>error </p>
             </td>
          </tr>
@@ -4146,6 +4238,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -4181,6 +4276,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -4216,6 +4314,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -4251,6 +4352,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -4286,6 +4390,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -4321,6 +4428,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -4356,6 +4466,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -4391,6 +4504,9 @@ X = FILTER A BY (f1 matches '.*apache.*'
             <td>
                <p>error </p>
             </td>
+            <td>
+               <p>error </p>
+            </td>
          </tr>
          <tr>
             <td>
@@ -4424,7 +4540,48 @@ X = FILTER A BY (f1 matches '.*apache.*'
                <p></p>
             </td>
             <td>
-               <p>error</p>
+               <p>boolean </p>
+            </td>
+            <td>
+               <p>error </p>
+            </td>
+         </tr>
+         <tr>
+            <td>
+               <p>boolean </p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p></p>
+            </td>
+            <td>
+               <p>boolean </p>
             </td>
          </tr>
    </table>
@@ -5044,6 +5201,14 @@ B = FOREACH A GENERATE -x, y;
                <p>double (as double) </p>
             </td>
          </tr>
+         <tr>
+            <td>
+               <p>datetime </p>
+            </td>
+            <td>
+               <p>error </p>
+            </td>
+         </tr>
    </table>
    </section>
   

Modified: pig/trunk/src/docs/src/documentation/content/xdocs/func.xml
URL: http://svn.apache.org/viewvc/pig/trunk/src/docs/src/documentation/content/xdocs/func.xml?rev=1411522&r1=1411521&r2=1411522&view=diff
==============================================================================
--- pig/trunk/src/docs/src/documentation/content/xdocs/func.xml (original)
+++ pig/trunk/src/docs/src/documentation/content/xdocs/func.xml Tue Nov 20 03:25:05 2012
@@ -3253,6 +3253,923 @@ Use the UPPER function to convert all ch
 </section>
 <!-- End String Functions -->
 
+<!-- ======================================================== -->
+<!-- ======================================================== -->   
+
+<!-- Datetime Functions -->
+<section id="datetime-functions">
+<title>Datetime Functions</title>
+
+<p>
+For general information about datetime type operations, see the <a href="http://download.oracle.com/javase/6/docs/api/">Java API Specification</a>, 
+<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Date.html">Java Date class</a>, and <a href="http://joda-time.sourceforge.net/apidocs/index.html">JODA DateTime class</a>.
+And for the information of ISO date and time formats, please refer to <a href="http://www.w3.org/TR/NOTE-datetime">Date and Time Formats</a>.
+</p>
+
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++ -->
+ <section id="add-duration">
+   <title>AddDuration</title>
+   <p>Returns the result of a DateTime object plus a <a href="http://en.wikipedia.org/wiki/ISO_8601#Durations">Duration object</a>.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>AddDuration(datetime, duration)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+         </tr> 
+                <tr>
+            <td>
+               <p>duration</p>
+            </td>
+            <td>
+               <p>The duration string in <a href="http://en.wikipedia.org/wiki/ISO_8601#Durations">ISO 8601 format</a>.</p>
+            </td>
+         </tr> 
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the AddDuration function to created a new datetime object by add some duration to a given datetime object.
+     </p>
+
+</section>
+</section> 
+
+<!-- ======================================================== -->  
+ <section id="current-time">
+   <title>CurrentTime</title>
+   <p>Returns the DateTime object of the current time.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>CurrentTime()</p>
+            </td>
+         </tr>
+   </table>
+   </section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the CurrentTime function to generate a datetime object of current timestamp with millisecond accuracy.
+     </p>
+</section>
+</section> 
+
+
+<!-- ======================================================== -->  
+ <section id="days-between">
+   <title>DaysBetween</title>
+   <p>Returns the number of days between two DateTime objects.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>DaysBetween(datetime1, datetime2)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime1</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr> 
+        <tr>
+            <td>
+               <p>datetime2</p>
+            </td>
+            <td>
+               <p>Another datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the DaysBetween function to get the number of days between the two given datetime objects. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="get-day">
+   <title>GetDay</title>
+   <p>Returns the day of a month from a DateTime object.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>GetDay(datetime)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the GetDay function to extract the day of a month from the given datetime object. 
+     </p>
+</section>
+</section> 
+
+<!-- ======================================================== -->  
+ <section id="get-hour">
+   <title>GetHour</title>
+   <p>Returns the hour of a day from a DateTime object.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>GetHour(datetime)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the GetHour function to extract the hour of a day from the given datetime object. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="get-milli-second">
+   <title>GetMilliSecond</title>
+   <p>Returns the millisecond of a second from a DateTime object.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>GetMilliSecond(datetime)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the GetMilliSecond function to extract the millsecond of a second from the given datetime object. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="get-minute">
+   <title>GetMinute</title>
+   <p>Returns the minute of a hour from a DateTime object.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>GetMinute(datetime)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the GetMinute function to extract the minute of a hour from the given datetime object. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="get-month">
+   <title>GetMonth</title>
+   <p>Returns the month of a year from a DateTime object.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>GetMonth(datetime)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the GetMonth function to extract the month of a year from the given datetime object. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="get-second">
+   <title>GetSecond</title>
+   <p>Returns the second of a minute from a DateTime object.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>GetSecond(datetime)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the GetSecond function to extract the second of a minute from the given datetime object. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="get-week">
+   <title>GetWeek</title>
+   <p>Returns the week of a week year from a DateTime object.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>GetWeek(datetime)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the GetWeek function to extract the week of a week year from the given datetime object.
+Note that week year may be different from year. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="get-week-year">
+   <title>GetWeekYear</title>
+   <p>Returns the week year from a DateTime object.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>GetWeekYear(datetime)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the GetWeekYear function to extract the week year from the given datetime object.
+Note that week year may be different from year.
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="get-year">
+   <title>GetYear</title>
+   <p>Returns the year from a DateTime object.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>GetYear(datetime)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the GetYear function to extract the year from the given datetime object. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="hours-between">
+   <title>HoursBetween</title>
+   <p>Returns the number of hours between two DateTime objects.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>HoursBetween(datetime1, datetime2)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime1</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr> 
+        <tr>
+            <td>
+               <p>datetime2</p>
+            </td>
+            <td>
+               <p>Another datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the HoursBetween function to get the number of hours between the two given datetime objects. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="milli-seconds-between">
+   <title>MilliSecondsBetween</title>
+   <p>Returns the number of milliseconds between two DateTime objects.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>MilliSecondsBetween(datetime1, datetime2)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime1</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr> 
+        <tr>
+            <td>
+               <p>datetime2</p>
+            </td>
+            <td>
+               <p>Another datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the MilliSecondsBetween function to get the number of millseconds between the two given datetime objects. 
+     </p>
+</section>
+</section> 
+
+<!-- ======================================================== -->  
+ <section id="minutes-between">
+   <title>MinutesBetween</title>
+   <p>Returns the number of minutes between two DateTime objects.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>MinutesBetween(datetime1, datetime2)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime1</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr> 
+        <tr>
+            <td>
+               <p>datetime2</p>
+            </td>
+            <td>
+               <p>Another datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the MinutsBetween function to get the number of minutes between the two given datetime objects. 
+     </p>
+</section>
+</section> 
+
+<!-- ======================================================== -->  
+<section id="months-between">
+   <title>MonthsBetween</title>
+   <p>Returns the number of months between two DateTime objects.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>MonthsBetween(datetime1, datetime2)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime1</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr> 
+        <tr>
+            <td>
+               <p>datetime2</p>
+            </td>
+            <td>
+               <p>Another datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the MonthsBetween function to get the number of months between the two given datetime objects. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="seconds-between">
+   <title>SecondsBetween</title>
+   <p>Returns the number of seconds between two DateTime objects.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>SecondsBetween(datetime1, datetime2)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime1</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr> 
+        <tr>
+            <td>
+               <p>datetime2</p>
+            </td>
+            <td>
+               <p>Another datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the SecondsBetween function to get the number of seconds between the two given datetime objects. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="subtract-duratioin">
+   <title>SubtractDuration</title>
+   <p>Returns the result of a DateTime object minus a <a href="http://en.wikipedia.org/wiki/ISO_8601#Durations">Duration object</a>.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>SubtractDuration(datetime, duration)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+         </tr> 
+                <tr>
+            <td>
+               <p>duration</p>
+            </td>
+            <td>
+               <p>The duration string in <a href="http://en.wikipedia.org/wiki/ISO_8601#Durations">ISO 8601 format</a>.</p>
+            </td>
+         </tr> 
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the AddDuration function to created a new datetime object by add some duration to a given datetime object.
+      </p>
+</section>
+</section> 
+
+<!-- ======================================================== -->  
+ <section id="to-date">
+   <title>ToDate</title>
+   <p>Returns a DateTime object according to parameters.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>ToDate(milliseconds)</p>
+               <p>ToDate(iosstring)</p>
+               <p>ToDate(userstring, format)</p>
+               <p>ToDate(userstring, format, timezone)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>millseconds</p>
+            </td>
+            <td>
+               <p>The offset from 1970-01-01T00:00:00.000Z in terms of the number milliseconds (either positive or negative).</p>
+            </td>
+        </tr> 
+        <tr>
+            <td>
+               <p>isostring</p>
+            </td>
+            <td>
+               <p>The datetime string in the <a href="http://www.w3.org/TR/NOTE-datetime">ISO 8601 format</a>.</p>
+            </td>
+        </tr>
+        <tr>
+            <td>
+               <p>userstring</p>
+            </td>
+            <td>
+               <p>The datetime string in the user defined format.</p>
+            </td>
+        </tr>
+        <tr>
+            <td>
+               <p>format</p>
+            </td>
+            <td>
+               <p>The date time format pattern string (see <a href="http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html">Java SimpleDateFormat class</a>).</p>
+            </td>
+        </tr>
+        <tr>
+            <td>
+               <p>timezone</p>
+            </td>
+            <td>
+               <p>The timezone string. Either the UTC offset and the location based format can be used as a parameter, while internally the timezone will be converted to the UTC offset format.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the ToDate function to generate a DateTime object. Note that if the timezone is not specified with the ISO datetime string or by the timezone parameter, the default timezone will be used.
+      </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="weeks-between">
+   <title>WeeksBetween</title>
+   <p>Returns the number of weeks between two DateTime objects.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>WeeksBetween(datetime1, datetime2)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime1</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr> 
+        <tr>
+            <td>
+               <p>datetime2</p>
+            </td>
+            <td>
+               <p>Another datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the WeeksBetween function to get the number of weeks between the two given datetime objects. 
+     </p>
+</section>
+</section>
+
+<!-- ======================================================== -->  
+ <section id="years-between">
+   <title>YearsBetween</title>
+   <p>Returns the number of years between two DateTime objects.</p>
+
+<section>
+   <title>Syntax</title>
+   <table>
+       <tr>
+            <td>
+               <p>YearsBetween(datetime1, datetime2)</p>
+            </td>
+         </tr>
+   </table>
+ </section>
+   
+<section>
+   <title>Terms</title>
+   <table>
+       <tr>
+            <td>
+               <p>datetime1</p>
+            </td>
+            <td>
+               <p>A datetime object.</p>
+            </td>
+        </tr> 
+        <tr>
+            <td>
+               <p>datetime2</p>
+            </td>
+            <td>
+               <p>Another datetime object.</p>
+            </td>
+        </tr>
+   </table>
+</section>
+
+<section>
+     <title>Usage</title>
+     <p>
+Use the YearsBetween function to get the number of years between the two given datetime objects. 
+     </p>
+</section>
+</section>
+</section>
+<!-- End DateTime Functions -->
 
 <!-- ======================================================== -->
 <!-- ======================================================== -->