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

$$HTE^XLFDT(): Convert $H to External Format

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

Description

The $$HTE^XLFDT extrinsic function converts a $H formatted input date to an external formatted date.

Format

  $$HTE^XLFDT(x[,y])

Input Parameters

x:

(required) $H date (in quotes).

y:

(optional) Affects output as follows:

  • If NULL, `$D(y), return the written-out format.

  • If `$D(y) then return standard VA FileMan format.

  • If +y = 1 then return standard VA FileMan format.

  • If +y = 2 then return MM/DD/YY@HH:MM:SS format.

  • If +y = 3 then return DD/MM/YY@HH:MM:SS format.

  • If +y = 4 then return YY/MM/DD@HH:MM:SS format.

  • If +y = 5 then return MM/DD/YYYY@HH:MM:SS format.

  • If +y = 6 then return DD/MM/YYYY@HH:MM:SS format.

  • If +y = 7 then return YYYY/MM/DD@HH:MM:SS format.

  • If y contains a D then date only.

  • If y contains an F then output with leading spaces.

  • If y contains an M then only output HH:MM.

  • If y contains a P then output HH:MM:SS am/pm.

  • If y contains an S then force seconds in the output.

  • If y contains a Z then output with leading zeroes.

Output

returns

Returns the external format of a $H date.

 

Examples

Example 1

Return the date in the following format: Standard external format.

>S X=$$HTE^XLFDT("54786,40523")

>W X
Dec 31, 1990@11:15:23

Example 2

Return the date in the following format: MM/DD/YY@HH:MM:SS.

>S X=$$HTE^XLFDT("54786,40523",2)

>W X
12/31/90@11:15:23

Example 3

Return the date in the following format: MM/DD/YY@HH:MM:SS, omitting the seconds.

>S X=$$HTE^XLFDT("57386,33723","2M")

>W X
2/12/98@09:22

Example 4

Return the date in the following format: MM/DD/YYYY@HH:MM:SS.

>S X=$$HTE^XLFDT("57351,27199",5)

>W X
1/8/1998@07:33:19

Example 5

Return the date in the following format: DD/MM/YYYY@HH:MM:SS.

>S X=$$HTE^XLFDT("57351,27199",6)

W X
8/1/1998@07:33:19

Example 6

Return the date in the following format: YYYY/MM/DD@HH:MM:SS.

>S X=$$HTE^XLFDT("57351,27199",7)

W X
1998/1/8@07:33:19