Keyed list option

The scope of the -configure option can change based on your configuration, such as multi-threaded translations. You should set the -configure options at the top of each procedure that uses convert_date and which expects certain options to be set.

The-configure keyed list option permits a keyed list of date conversion options to be passed in and permanently set. These keys and options are the same ones used in the DATECOPYOPT xlate operation.

This table lists the options that control the behavior of the date conversion operation:

Key Value Description
FABRICATE boolean

This is used in tandem with the RANGE key.

  • If set to 1, then the default century that is added to the output string is the current century. This is only if the century is not present on the input side.
  • If set to 0 (false), then the RANGE key must be present to tell the conversion operation how to calculate the century. This applies only if a century needs to be added to the output.

For example:

{FABRICATE 1}
RANGE Three integer list

The first value in the RANGE key's list is the border, the next is the low century and the third is the high century.

  • If the year in the input string is less than or equal to the border, then the output uses the low century.
  • If the year in the input string is greater than the border, then the output uses the high century. No default and FABRICATE is false.

For example:

{RANGE {25 20 19}}
DELIMIT List of two delimiter characters

The value of the DELIMIT key is a list that specifies the two characters to use as the date separator character and time separator character. The default separator for dates is the / character, except for type fe which defaults to ".". The default for time is the ":" character.

For example:

{DELIMIT {- .}}
ADDPREC boolean

The ADDPREC key's value tells the date conversion operation whether to add precision to the output date/time string.

  • If the value is true, or 1, then fields such as seconds or timezone are added to the output string, created from the current date/time.
  • If the value is false, or 0, then optional fields not present in the input are not added to the output string.
  • For example, if a time is 145510 and this flag is false, no fractions of a second or timezone are added to the output.

For example:

{ADDPREC 0}
USECURTM boolean

Setting this value means the command references the system time when filling in missing values in the incoming date/time value.

  • When set to 1, convert_date uses the system time.
  • When set to 0, convert_date uses the time values defined in TMDEFS.

For example:

{USECURTM 1}
TMDEFS Tcl list

When USECURTM is set to 0, this key defines which values to use when filling in missing values in the incoming date/time value.

This splits the list of defaults for the various date and time related fields. All fields are optional and can be an empty list.

now can be used in any field to represent the value is filled in from the current time.

For example: Midnight January 1 would be:

{TMDEFS {01 01 00 00 00 0000 +0000}}