<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css">
<title>
Gambas Documentation - Week
</title>
</head>
<table class="none" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<font size="-1">
<a href="../../help+en"><img class="flag" alt="Home" border="0" src="../../img/lang/en.png" align="center"></a>&nbsp;
<a href="../lang+en">Up</a>&nbsp;
<a href="watch+en">Previous</a>&nbsp;
<a href="weekday+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
Week
</h1>
<div class="black"><font size="-2"><b>Syntax</b></font></div>
<pre class="syntax"><u>Result</u> <b>= Week (</b> <u>Date</u> AS Date [ <b>,</b> <u>FirstDayOfWeek</u> AS Integer <b>,</b> <u>FullWeek</u> AS Boolean ] <b>)</b></pre><p>

Returns the week number from a given date.
<p>
<ul>
<li><u>FirstDayOfWeek</u> is the first day of the week.<br>See <a href="../cat/constants+en">Language Constants</a> for a list of constants that represent a week day.
<p>
<li><u>FullWeek</u> tells if only entire weeks are counted.<br>If <u>FullWeek</u> is <a href="false+en">FALSE</a>, then the first partial week of the year is counted if it has at least four days in the year.
<p>
</ul>

Anyway, this function can return zero if we are before the first week of the year.
<p>
By default, the first day of the week is Monday, and partial weeks are counted.
<p>
See <a href="../cat/constant+en">Predefined Constants</a> for a list of constants associated with week days.
<p>
<div class="gray"><font size="-2"><b>Example</b></font></div>
<pre class="example">PRINT Week(&quot;07/24/2005&quot;)
<hr>29</pre>
<p>
<div class="gray"><font size="-2"><b>Example</b></font></div>
<pre class="example">PRINT Week(&quot;01/01/2005&quot;)
<hr>0</pre>
<p>
<div class="gray"><font size="-2"><b>Example</b></font></div>
<pre class="example">PRINT Week(&quot;01/01/2004&quot;)
<hr>1</pre>
<p>
<hr><b>See also</b><br>
<a href="../cat/time+en">Date &amp; Time Functions</a>&nbsp;

</div>
</body>
</html>

