<!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 - Vb.DateAdd
 (gb.vb)</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="../vb+en">Up</a>&nbsp;
<a href="../vb+en">Previous</a>&nbsp;
<a href="datediff+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
Vb.DateAdd
 (gb.vb)</h1>
<div class="black"><font size="-2"><b>Syntax</b></font></div>
<pre class="syntax"><font color="blue">STATIC</font> <font color="blue">FUNCTION</font> <b>DateAdd</b> <font color="blue">(</font> <u>period</u> <font color="blue">AS</font> <font color="#0080FF">String</font><font color="blue">,</font> <u>interval</u> <font color="blue">AS</font> <font color="#0080FF">Integer</font><font color="blue">,</font> <u>Date</u> <font color="blue">AS</font> <font color="#0080FF">Date</font> <font color="blue">)</font> <font color="blue">AS</font> <font color="#0080FF">Date</font></pre>
Returns a <a href="../../../lang/date+en">Date</a> to which a specified time interval has been added.
<p>
<u>Interval</u> is a string expression that is the interval of time you want to add.
<p>
<table class="table" border="0" bordercolor="#000000" cellpadding="4" cellspacing="0">
<tr><th>
Interval
</th><th>
Description
</th></tr>
<tr class="dark"><td valign="top">
<tt>yyyy</tt>
</td><td valign="top">
Year
</td></tr>
<tr><td valign="top">
<tt>q</tt>
</td><td valign="top">
Quarter
</td></tr>
<tr class="dark"><td valign="top">
<tt>m</tt>
</td><td valign="top">
Month
</td></tr>
<tr><td valign="top">
<tt>y</tt>
</td><td valign="top">
Day of year
</td></tr>
<tr class="dark"><td valign="top">
<tt>d</tt>
</td><td valign="top">
Day
</td></tr>
<tr><td valign="top">
<tt>w</tt>
</td><td valign="top">
Week day - Note: A week day is Monday to Friday in <a href="../../../def/gambas+en">Gambas</a>. This is different to VB in which w = d
</td></tr>
<tr class="dark"><td valign="top">
<tt>ww</tt>
</td><td valign="top">
Week
</td></tr>
<tr><td valign="top">
<tt>h</tt>
</td><td valign="top">
Hour
</td></tr>
<tr class="dark"><td valign="top">
<tt>n</tt>
</td><td valign="top">
Minute
</td></tr>
<tr><td valign="top">
<tt>s</tt>
</td><td valign="top">
Second
</td></tr>
</table>
<p>

<u>Period</u> is the number of intervals you want to add. It can be positive (to get dates in the future) or negative (to get dates in the past).
<p>
<u>Date</u> is a <a href="../../../lang/date+en">Date</a> or literal representing date to which the interval is added.

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

