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

$$HDIFF^XLFDT(): $H Difference

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

Description

The $$HDIFF^XLFDT extrinsic function returns the difference between two $H formatted dates.

Format

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

Input Parameters

x1:

(required) $H date (in quotes).

x2:

(required) $H date (in quotes) 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 $H difference.

Examples

Example 1

Return the $H difference in days.

>S X=$$HDIFF^XLFDT("54789,40523","54786,25983",1)

>W X
3

Example 2

Return the $H difference in seconds.

>S X=$$HDIFF^XLFDT("54789,40523","54786,25983",2)

>W X
273740

Example 3

Return the $H difference in days hours:minutes:seconds format (DD HH:MM:SS).

>S X=$$HDIFF^XLFDT("54789,40523","54786,25983",3)

>W X
3 4:02:20