Print Page as PDF
DIUTC ICR (6445)

DIUTC    ICR (6445)

Name Value
NUMBER 6445
IA # 6445
DATE CREATED 2016/08/05
CUSTODIAL PACKAGE VA FILEMAN
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE DIUTC
NAME DIUTC
GENERAL DESCRIPTION
This Coordinated Universal Time (UTC) API will convert
a FileMan date/time into Greenwich Mean Time (GMT) with a time zone offset
based on various input values entered by the user or the default institution
in the DUZ(2) variable.

The format of the default output will be a GMT represented in standard FileMan
date/time format and an internal three digit time zone offset appended to the
end.  The calculation for the internal offset is the external offset converted
to minutes, then divided by 5, and then added to 500.  So -07:00 is -420
minutes, then divided by 5 is -84, and added to 500 is 416.

There may be other output variables based on the value of the EXT input
parameter.  The details for the other output values are documented in the
$$UTC variable below.

To determine the offset, the API needs to have a TimeZone and Country.  These
values are determined using the following algorithm:

1.      No optional input parameters are passed in.  The user's default
Institution will be used based on the DUZ(2) variable.  The TimeZone and
Country are determined by the new fields in the Institution file.

2.      If only Institution is passed in as an input parameter, the TimeZone
and Country are determined by the new fields in the Institution file.

3.      The TimeZone and Country parameters are both passed in as input
parameters.


The UTC API will return an error for any of the following conditions:

1.      If the TimeZone or Country cannot be determined from any of the
methods documented above, an error will be returned.

2.      If the TimeZone parameter is passed in without Country parameter or
the Country parameter is passed in without a TimeZone parameter, an error will
be returned.

3.      If the Institution parameter is passed in with either the TimeZone or
Country parameter, an error will be returned.

4.      Once the TimeZone and Country are determined, they will be validated
for consistency.  An error will be returned if they are inconsistent e.g. if
user passes in TimeZone = "Australian Eastern Time" and Country="Mexico", the
UTC API will return an error.
STATUS Active
KEYWORDS
  • UTC
  • API
  • FILEMAN
  • DIUTC
DURATION Till Otherwise Agreed
ID DIUTC
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT VARIABLES
UTC(DTM,TMZ,INST,CNTRY,EXT)
VARIABLES TYPE VARIABLES DESCRIPTION
DTM Input
This required input parameter is a standard internal
or external FileMan DateTime. The Time portion of the input is required.  The
NOW input parameter is based on the current system time.  If NOW is passed in
with a TimeZone and Country that is different than the system's TimeZone and
Country, inconsistent output may occur.
TMZ Input
This optional input parameter is Time Zone.  It can
be either be a pointer to the WORLD TIMEZONES (#1.71) file or value from the
NAME (#.01) field if the WORLD TIMEZONES (#1.71) file  (e.g., EASTERN).
INST Input
This optional input parameter is a pointer to the
INSTITUTION (#4) file.
CNTRY Input
This optional input parameter is a pointer to the
COUNTRY CODE (#779.004) file or a valid entry from the CODE (#.01) field or
the upper-cased DESCRIPTION (#2) field of the COUNTRY CODE (#779.004) file.
EXT Input
This optional input parameter is an indicator whether
to return the default output (GMT+offset in internal format) or to include
extended output return values.  If the EXT parameter is null or missing, only
the default value is outputted.  If the EXT parameter is 1, additional values
are returned as documented in the $$UTC parameter below.
$$UTC Output
If the EXT input parameter is null, zero, or missing,
then the default output (GMT+offset in internal format) is returned.

If the EXT input parameter is set to 1, then the output is multiple caret '^'
delimited pieces:

Piece 1: GMT+offset in internal format (e.g, 3160105.080715416)

Piece 2: GMT+offset in external format (e.g., JAN 5,2016@08:07:15 (UTC-7:00)

Piece 3: Offset in external format (e.g., -7:00)

Piece 4: Time zone (e.g., EASTERN STANDARD TIME, ESTONIA STANDARD TIME)

Piece 5: Country Name (e.g., UNITED STATES, FRANCE)

Piece 6: Time zone abbreviation (e.g., EST, PST)

Piece 7: Timeframe (e.g., DAYTLIGHT, STANDARD, SUMMER)

Piece 8: Institution Name
DATE ACTIVATED 2017/06/23