Print Page as PDF
XLFDT ICR (10103)

XLFDT    ICR (10103)

Name Value
NUMBER 10103
IA # 10103
DATE CREATED 2000/11/27
CUSTODIAL PACKAGE KERNEL
CUSTODIAL ISC San Francisco
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE XLFDT
NAME XLFDT
ORIGINAL NUMBER 10103
GENERAL DESCRIPTION
Several date/time API's.
STATUS Active
KEYWORDS DATE
ID XLFDT
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
$$HTFM(x,y)
To change a date from $H format to VA FileMan format.

arguments:  x  $H date (in quotes)
y  1 (optional) to return the date portion only (no seconds)
$$FMTH(x,y)
To change a date from VA FileMan format to $H format.

arguments:  x  FileMan date
y  1 (optional) to return the date portion only (no seconds)
$$HTE(x,y)
To change a date in $H format to an external format

arguments:  x  $H date (in quotes)
y  see FMTE(x,y) for alternate values
$$FMTE(x,y)
To change a date in VA FileMan format to an external
format.
$$DOW(x,y)
To change a date in VA FileMan format to the
corresponding day of the week.
$$HDIFF(x1,x2,x3)
To calculate the difference between two dates in $H
format.
$$FMDIFF(x1,x2,x3)
To calculate the difference between two dates in VA
FileMan format.  x3 also serves as an argument
1, return difference in days
2, return difference in seconds
3, return difference in DD HH:MM:SS format
$$HADD(x,d,h,m,s)
To add days, hours, minutes, and seconds to a date in
$H format (to x)
$$FMADD(x,d,h,m,s)
To add days, hours, minutes, and seconds to a
date/time in VA FileMan format (to x).
$$DT
Returns current date in FileMan format.
$$NOW
Returns current date/time in FileMan format.
$$FMTHL7(fm_date/time)
To change a date from VA FileMan format to HL7 format
including the time offset.

W $$FMTHL7^XLFDT(3001127.1525)  => 200011271525-0800
$$HL7TFM(HL7 date/time[,Local/UTC])
To change a date from HL7 format to VA FileMan
format.  W $$HL7TFM^XLFDT("200011271525-0700") => 3001127.1525

The optional second parameter controls if any time offset is applied to the
time. If a time offset is included then time offset can be applied to give UTC
time or the local time offset from the Mailman Time Zone file can be used to
give Local time.

To get UTC time W $$HL7TFM^XLFDT("200011271525-0700","U") => 3001127.2225

To get Local time in PST.  W $$HL7TFM^XLFDT("200011271525-0700","L") =>
3001127.1425
$$SCH(schedule,lasttime,futureflag)
This API decodes a schedule to give the next time in
the schedule.  See the Kernel Library documentation for more detail on the
schedule string.  The return value is a FileMan format date/time.
VARIABLES TYPE VARIABLES DESCRIPTION
schedule Input
This is a string that describes the schedule.  From
the Kernel Library Doc.

nS      add n seconds to base_date
nH      add n hours to base_date
nD      add n days to base_date
nM      add n months to base_date
$H;$H;$H        List of $H dates
nM(list)        complex month increment ie: 1M(15,L)
dd[@time]               day of month ie: 12
nDay[@time]     day of week in month  ie: 1M
first monday
Day
L                       last day of month
LDay                    ie: LW   last wednesday of month

Day[@time]...
Day
D = weekday
E = weekend

Day =   M monday
T tuesday
W wednesday
R thursday
F friday
S saturday
U sunday
lasttime Input
This is the last date/time (or base time) for the
schedule. The next date/time is figured from this point in time. It can be in
FileMan format e.g. 3011018.08 or in $H format e.g. 58730,28800.
futureflag Input
This flag, if set to 1, will check that the returned
date/time is greater than the current date/time.
$$SEC(FM or $H value)
This entry point will convert either a FM or $H value
to the number of seconds since the start for $H.  W $$SEC^XLFDT(3021118.1347)
=>> 5108536020
$$%H(seconds)
This entry point converts the output of $$SEC^XLFDT
back to a $H value.

W $$%H^XLFDT(5108536020) =>> 59126,49620
$$TZ()
This entry point returns the Time Zone offset from
UTC.

For Pacific standard time: W $$TZ^XLFDT =>> -0800
$$FR(x)
Checks x (FileMan date/time) is within the approved
range.  Returns 0 if x is approved, 1 if x is out of range.
VARIABLES TYPE VARIABLES DESCRIPTION
x Input
Internal format of FileMan date/time