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

$$FMTE^XLFDT(): Convert VA FileMan Date to External Format

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

Description

The $$FMTE^XLFDT extrinsic function converts a VA FileMan formatted input date to an external formatted date.

Format

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

Input Parameters

x:

(required) VA FileMan date.

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 xternal formatted date.

Examples

Example 1

Return the date in the following format: Standard VA FileMan date format.

>S X=$$FMTE^XLFDT(2940629.105744,1)

>W X
Jun 29, 1994@10:57:44

Example 2

Return the date in the following format: Standard VA FileMan date format and include am/pm.

>S X=$$FMTE^XLFDT(2940629.1057,"1P")

>W X
Jun 29, 1994 10:57 am

Example 3

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

>S X=$$FMTE^XLFDT(2940629.105744,2)

>W X
6/29/94@10:57:44

Example 4

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

>S X=$$FMTE^XLFDT(2940629.105744,"2M")

>W X
6/29/94@10:57

Example 5

Return the date in the following format: MM/DD/YY@HH:MM and include am/pm.

>S X=$$FMTE^XLFDT(2940629.105744,"2P")

>W X
6/29/94@10:57:44 am

Example 6

Return the date in the following format: MM/DD/YY@HH:MM:SS, forcing seconds to display when no seconds were included in the input parameter.

>S X=$$FMTE^XLFDT(2940629.1057,"2S")

>W X
6/29/94@10:57:00

Example 7

Return the date in the following format: MM/DD/YY@HH:MM:SS, forcing seconds to display when no seconds were included in the input parameter, and include leading spaces.

>S X=$$FMTE^XLFDT(2940629.1057,"2SF")
 
>W X
 6/29/94@10:57:00

Example 8

Return the date in the following format: DD/MM/YY@HH:MM:SS and include leading spaces.

>S X=$$FMTE^XLFDT(2940629.105744,"3F")

>W X
29/ 6/94@10:57:44

Example 9

Return the date in the following format: YY/MM/DD, ignore the time values entered and only display the date.

>S X=$$FMTE^XLFDT(2940629.1057,"4D")

>W X
94/6/29

Example 10

To output a really short date/time try the following, convert space to zero and remove slash, as shown below:

>S X=$TR($$FMTE^XLFDT(2940629.1057,"4F")," /","0")

>W X
940629@10:57

Example 11

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

>S X=$$FMTE^XLFDT(3000229.110520,5)

>W X
2/29/2000@11:05:20

Example 12

Return the date in the following format: MM/DD/YYYY@HH:MM:SS and include leading spaces.

>S X=$$FMTE^XLFDT(3000229.110520,"5F")

>W X
 2/29/2000@11:05:20

Example 13

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

>S X=$$FMTE^XLFDT(3000229.1105,"5S")

>W X
2/29/2000@11:05:00

Example 14

Return the date in the following format: MM/DD/YYYY@HH:MM:SS, include leading zeroes, and include am/pm.

>S X=$$FMTE^XLFDT(3000229.110520,"5ZP")

>W X
02/29/2000 11:05:20 am

Example 15

Return the date in the following format: DD/MM/YYYY@HH:MM:SS, with leading spaces.

>S X=$$FMTE^XLFDT(3000229.110520,"6F")
 
>W X
29/ 2/2000@11:05:20

Example 16

Return the date in the following format: DD/MM/YYYY@HH:MM:SS, with leading zeroes.

>S X=$$FMTE^XLFDT(3000229.1105,"6Z")

>W X
29/02/2000@11:05

Example 17

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

>S X=$$FMTE^XLFDT(3000301.1105,7)

>W X
2000/3/1@11:05

Example 18

Return the date in the following format: YYYY/MM/DD, ignore the time values entered and only display the date.

>S X=$$FMTE^XLFDT(3000301.1105,"7D")

>W X
2000/3/1