Implemented in version 2.0
DateDiff(Interval, Date1, Date2, FirstDayofWeek, FirstWeekofYear)
The DateDiff function calculates the amount of time between two different dates.
There are three mandatory arguments.
The Interval argument defines the the type of time interval you wish to use to calculate the time difference.
Only the following settings can be used. You must place the setting inside a pair of double quotes.
||Day Of Year
||Week Of Year
The Date1 argument is the first date.
The Date2 argument is the second date.
<%=DateDiff("d", Date, "1/1/2000") %>
The order of the two dates determines if the difference is represented as a positive or negative value.
<% olddate = #6/26/43# %>
<% nowdate = Now %>
<% =DateDiff("s", nowdate, olddate) %>
There are two optional arguments.
The FirstDayofWeek argument must only use the constants or values defined below in the Date And Time CONSTANTS.
||Week of January
of the year that has at least four days
week of the year
||Use the date
format of the computer's regionsl settings
||Use the first
full day of the week as defined by the system settings
In this example, Tuesday is defined to be the first day of the week. The output is how many weeks, which are now defined to start on Tuesday, are left between the current date and 1/1/2001.
<% =DateDiff("w", Date, "1/1/2001", 3) %>
<% =DateDiff("w", Date, "1/1/2001", VBTUESDAY) %>
The FirstWeekofYear argument must only use the constants or values defined in the Date And Time CONSTANTS which are listed above.
<% =DateDiff("ww", Date, "1/1/2001", 1, VBFIRSTFOURDAYS)%>
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.