<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.weekFromDate.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.weekFromDate</api:function-name><api:suggest>xdmp.weekfromdate</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>weekfromdate</api:suggest><api:function-link mode="xquery" fullname="xdmp:week-from-date">/apidoc/8.0/xdmp:week-from-date.xml</api:function-link><api:function mode="javascript" name="weekFromDate" type="builtin" lib="xdmp" category="DurationDateTimeBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.weekFromDate"><api:summary>
<p xmlns="http://www.w3.org/1999/xhtml">Returns an xs:integer between 1 and 53, both inclusive, representing the week
value in the localized value of $arg.
</p><p xmlns="http://www.w3.org/1999/xhtml">
If $arg is the empty sequence, returns the empty sequence.
</p>
</api:summary><api:params><api:param name="arg" type="xs:date?"><api:param-description>
The date whose weeks of the year will be returned.
  </api:param-description><api:param-name>arg</api:param-name><api:param-type>Date?</api:param-type></api:param></api:params><api:return>Number?</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.weekFromDate(xs.date("2012-05-16"))
=&gt; 20
</pre>
</api:example><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.weekFromDate(xs.date("2000-01-01"))
=&gt; 52
</pre>
</api:example></api:function></api:function-page>