Home | Advertising Info147 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Thursday, December 14, 2017  


VBscript Built-in Functions

Back to Function List

DateSerial

Gives a Variant of subtype Date for a specified year, month, and day

DateSerial(year, month, day)

The DateSerial function syntax has these arguments:

 

Part Description
year Number between 100 and 9999, inclusive, or a numeric expression.
month Any numeric expression.
day Any numeric expression.
 

To specify a date, such as December 31, 1991, the range of numbers for each DateSerial argument should be in the normally accepted range for the unit; that is, 131 for days and 112 for months. However, you can also specify relative dates for each argument using any numeric expression that represents some number of days, months, or years before or after a certain date.

The following example uses numeric expressions instead of absolute date numbers. Here the DateSerial function returns a date that is the day before the first day (1 - 1) of two months before August (8 - 2) of 10 years before 1990 (1990 - 10); in other words, May 31, 1980.

 

DateSerial(1990 - 10, 8 - 2, 1 - 1)
For the year argument, values between 0 and 99, inclusive, are interpreted as the years 19001999. For all other year arguments, use a complete four-digit year (for example, 1800).

When any argument exceeds the normally accepted range for that argument, it increments to the next larger unit as appropriate. For example, if you specify 35 days, it is evaluated as one month and some number of days, depending on where in the year it is applied. However, if any single argument is outside the range -32,768 to 32,767, or if the date specified by the three arguments, either directly or by expression, falls outside the acceptable range of dates, an error occurs.





   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright 1998 - 2017 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com