[TOC] [Prev] [Next] [Bottom]



<@DATEDIFF>

Syntax

<@DATEDIFF DATE1=firstdate DATE2=seconddate [FORMAT=format]>

Description

Returns the number of days between the two dates specified.

For more information, see <@ISDATE>, <@ISTIME>, <@ISTIMESTAMP>.

<@DATEDIFF> handles ODBC, ISO, some numeric formats, and textual formats.

If the date is entered incorrectly--wrong separators or wrong values for year, month or day--the tag returns "Invalid date!".

The date attributes are mandatory. If no attribute is found while the expression is parsed, the tag returns "No attribute!".

All formats assume the Gregorian calendar. All years must be greater than zero.


! Note: When a two-digit year is given, the following centuries are assumed:

Value

Century

00-36

2000s

37-99

1900s

For example, a two-digit year of 99 is evaluated as 1999, and a two-digit year of 00 is evaluated as 2000.


Example

The date returned is calculated as DATE1 minus DATE2.

<@DATEDIFF DATE1=1998-02-20 DATE2=1998-02-27>

This tag returns "-7", the number of days between the two dates.

See Also

<@DAYS>
<@FORMAT>
Format Attribute
<@ISDATE>, <@ISTIME>, <@ISTIMESTAMP>



[TOC] [Prev] [Next] [Bottom]



docs@pervasive.com

Copyright © 1999, Pervasive Software. All rights reserved.