Print Page as PDF
Classic FileMan API: Date/Time Manipulation ICR (10000)

Classic FileMan API: Date/Time Manipulation    ICR (10000)

Name Value
NUMBER 10000
IA # 10000
DATE CREATED 1994/04/08
CUSTODIAL PACKAGE VA FILEMAN
CUSTODIAL ISC San Francisco
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE %DTC
NAME Classic FileMan API: Date/Time Manipulation
ORIGINAL NUMBER 10000
GENERAL DESCRIPTION
Date and Time manipulation and Number formating.
STATUS Active
ID %DTC
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
%DTC
Returns the number of days between two dates.
VARIABLES TYPE VARIABLES DESCRIPTION
X1 Input
One date of the required two in VA FileMan format.
Required and not returned.
X2 Input
The other date in VA FileMan format.  Required and
not returned.
X Output
The number of days between the two dates.  X2 is
subtracted from X1.
%Y Output
If %Y is equal to 1, the dates have both month and
day values.

If %Y is equal to 0, the dates were imprecise and therefore not workable.
C
Takes a date and adds or subtracts a number of days,
returning a VA FileMan date and a $H format date.  If time is included with
the input, it will also be included with the output.
VARIABLES TYPE VARIABLES DESCRIPTION
X1 Input
The date in VA FileMan format to which days are going
to be added or subtracted.  Required and not returned.
X2 Input
If positive, the number of days to add.  If negative,
the number of days to subtrct.  Required and not returned.
X Output
The resulting date after the operation has been
performed in VA FileMan format.
%H Output
The $H form of the date.
NOW
Returns the current date/time in VA FileMan and $H
formats.
VARIABLES TYPE VARIABLES DESCRIPTION
% Output
VA FileMan date/time down to the second.
%H Output
$H date/time.
%I(1) Output
The numeric value of the month.
%I(2) Output
The numeric value of the day.
%I(3) Output
The numeric value of the year.
X Output
VA FileMan date only.
H
Converts a VA FileMan date/time to a $H formate
date/time.
VARIABLES TYPE VARIABLES DESCRIPTION
X Input
The date/time in VA FileMan format.  Required and
returned.
%H Output
The same date in $H format.  If the date is
imprecise, then the first of the month or year is returned.
%T Output
The time in $H format, i.e., the number of seconds
since midnight.  If there is no time, then %T equals zero.
%Y Output
The day-of-week as a numeric from 0 to 6, where 0
means Sunday and 6 means Saturday.  If the date is imprecise, then %Y is equal
to -1.
DW
This entry point produces results similar to H^%DTC.
The difference is that X is reset to the name of the day of the week - Sunday,
Monday, etc.  If the date is imprecise, then X is returned equal to null.
YMD
Converts a $H format date to a VA FileMan date.
VARIABLES TYPE VARIABLES DESCRIPTION
%H Both
A $H format date/time.  Required and returned.
% Output
Time down to the second in VA FileMan format, that
is, as a decimal.  If %H does not have time, then % equals zero.
X Output
The date in VA FileMan format.
COMMA
Formats a number to a string that will separate
billions, millions, and thousands with commas.
VARIABLES TYPE VARIABLES DESCRIPTION
X Input
The number you want to format.  X is required and it
may be positive or negative.
X2 Input
The number of decimal digits we want the output to
have.  If X2 is not defined, two decimal digits are returned.  If X2 is a
number followed by the dollar sign (e.g., 3$) then a dollar sign will be
prefixed to X before it is output.
X3 Input
The length of the desired output.  If X3 is less than
the formatted X, X3 will be ignored.  If X3 is not defined, then a length of
twelve is used.
X Output
The initial value of X, formatted with commas,
rounded to the number of decimal digits specified in X2.  If X2 contained a
dollar sign, then the dollar sign will be next to the leftmost digit.  If X
was negative, then the returned value of X will be in parentheses.  If X was
positive, a trailing space will be appended.  If necessary, X will be padded
with leading spaces so that the length of X will equal the value of the X3
input variable.
S
Converts number of seconds since midnight to hours,
minutes, and seconds as a decimal part of FileMan date.
VARIABLES TYPE VARIABLES DESCRIPTION
% Input
Number of seconds from midnight (Input).

Decimal part of FileMan date (Output).
YX
This entry point takes a $H date and passes back a
printable date/time.  It also passes back the VA FileMan form of the date and
time.
VARIABLES TYPE VARIABLES DESCRIPTION
%H Both
This contains the date and time in $H format which is
to be converted.  Time is optional.  Required and returned.
Y Output
The date and time (if time has been sent) in external
format.  Seconds will be included if the input contained seconds.
X Output
The date in VA FileMan format.
% Output
The time as a decimal value inVA FileMan format.  If
time was not sent, then % will be returned as zero.
HELP
This entry point displays a help prompt based on %DT
and %DT(0).
VARIABLES TYPE
%DT Input
%DT(0) Input