Kernel 8.0 APIs Banner
Office of Information and Technology (OIT) Banner
[skip navigation]

$$FMDIFF^XLFDT(): VA FileMan Date Difference

Reference Type: Supported, Category: Date Functions, ICR#: 10103

Description

The $$FMDIFF^XLFDT extrinsic function returns the difference between two VA FileMan format dates.

Format

  $$FMDIFF^XLFDT(x1,x2[,x3])

Input Parameters

x1:

(required) VA FileMan date.

x2:

(required) VA FileMan date, to subtract from the x1 date.

x3:

(optional) If NULL, `$D(x3), return the difference in days. Otherwise:

  • If x3 = 1, return the difference in days.

  • If x3 = 2, return the difference in seconds.

  • If x3 = 3, return the difference in days hours:minutes:seconds format (DD HH:MM:SS).

Output

returns:

Returns the date and/or time difference.

Examples

Example 1

The following example returns the difference between two dates/times in days (x3 = NULL or 1). In this example, the first date is 2 days less than the second date:

>S X=$$FMDIFF^XLFDT(2901229,2901231.111523)

>W X
-2
>S X=$$FMDIFF^XLFDT(2901229,2901231.111523,1)

>W X
-2

Example 2

The following example returns the difference between two dates/times in seconds (x3 = 2). In this example, the first date is 150,079 seconds greater than the second date:

>S X=$$FMDIFF^XLFDT(2901231.111523,2901229.173404,2)

>W X
150079

Example 3

The following example returns the difference between two dates/times in DD HH:MM:SS (x3 = 3). In this example, the first date is 1 day, 1 hour, 24 minutes, and 2 seconds greater than the second date:

>S X=$$FMDIFF^XLFDT(2901231.024703,2901230.012301,3)

>W X
1 1:24:2