You are here: Adding Section and Field Rules > Formatting Data > Using Pre-defined Date Formats

Using Pre-defined Date Formats

In this example...

d,"1/4",

…the d indicates it is a date format, as opposed to a number format (n). The first digit (1) indicates the date format (MM/DD/YY). The forward slash (/) indicates the separator character (/) and the third digit (4) indicates the number of digits in the year. See DateFmt for the complete list of date formats.

Note Because of year 2000 considerations, use four-digit years.

In cases where you do not need a separator, such as format 4 or B, you can specify the date as “4/2” for format 4 with a two-digit year. The system ignores the slash (/).

This example shows the date format as it looks in the FAP file. The easiest way to enter date formats is through Studio, on the field’s Properties window.

Field options

Studio will then create the date format in the FAP file for you.

When you choose Date Format as the type, you can choose from this list of date formats. The table also shows the corresponding date format code Studio creates in the FAP file:

In the Format field, select this format

To see this code in the FAP file

To get dates formatted as shown below (all examples are for January 2, 2014)

MM/DD/YY

1

01/02/13 (default)

DD/MM/YY

2

02/01/13

YY/MM/DD

3

13/01/02

Month D, Yr

4

January 2, 2014

M/D/YY

5

1/2/13

D/M/YY

6

 

YY/M/D

7

13/1/2

bM/bD/YY

8

 

bD/bM/YY

9

 

YY/bM/bD

A

13/ 1/ 2

MMDDYY

B

010213

DDMMYY

C

020113

YYMMDD

D

130102

MonDDYY

E

Jan0213

DDMonYY

F

02Jan13

YYMonDD

G

13Jan02

DAY/YY

H

002/13

YY/DAY

I

13/002

D Month, Yr

J

02 January, 2014

Yr, Month D

K

2014, January 02

Mon-DD-YYYY

L

Jan-02-2014

DD-Mon-YYYY

M

02-Jan-2014

YYYY-Mon-DD

N

2014-Jan-02

Mon DD, YYYY

O

Jan 02, 2014

DD Mon, YYYY

P

02 Jan, 2014

YYYY, Mon DD

Q

2014, Jan 02

(hexadecimal)

X

Eight-character hexadecimal representation of the system date. Valid dates range from 12/31/1969 to 01/18/2038. Valid dates may differ depending on the type of machine (PC or host) and the type of CPU chip.

These date formats affect processing in Documaker Desktop, not Documaker Server.

Here is a list of the separators you can choose from in the Separators field on the Attributes tab of the variable field’s Properties window.

In the Separator field, choose...

To use this character as the separator...

00/00/00 (default)

/ (a slash appears in the FAP file)

00-00-00

- (a dash appears in the FAP file)

00.00.00

. (a period appears in the FAP file)

00,00,00

, (a comma appears in the FAP file)

00 00 00

blank (a “b” appears in the FAP file)

In the Year Size field on the Attributes tab of the variable field’s Properties window, you can choose from these options...

To use...

Select...

A two-digit year such as 01/01/13 (use only if the year is in current century)

2 (a “2” appears in the FAP file)

Only a two-digit year such as 01/01/13 (if you enter anything other than a two-digit year, you will receive an error)

3 (a “3” appears in the FAP file)

A four-digit year such as 01/01/2014

4 (a “4” appears in the FAP file)

Only a four-digit year such as 01/01/2014 (if you enter anything other than a four-digit year, you will receive an error)

5 (a “5” appears in the FAP file)

The year as entered without changing it

Default (a blank space appears in the FAP file)

2-digit years

You can force 2-digit years when you use the FmtDate rule, even if doing so means the date may not be interpreted correctly when it is compared to the century cut-off date. To force a 2-digit year, you must specify the output format as “1/3” instead of “1/2”. Here is an example:

;0;0;DRVR-BIRTH-DT;1022;8;DRVR-BIRTH-DT;0;8;d,"B4",d,"1/3";
FmtDate;5,DRVRREC01,;N;N;N;N;3367;3600;11011;

The 3 is a format mask (normally used for input) which means 2-digits and only 2-digits.

Century cut-off dates

The century cut-off date is used to determine the century for 2-digit years. This date defaults to 50, but you can change it using this INI option:

< Control >

DateFMT2To4Year =

Anything less than or equal to the cut-off year is considered to fall in the current century. For instance using the default of 50, 13 would be interpreted as 2014. Anything greater than the cut-off year is considered to fall in the previous century. For instance, again using the default of 50, 88 would be interpreted as 1988.

This is important when you have to determine the years or days between two dates.

There is a scenario where the system overrides a 2-digit year output. This only happens when the input has 4-digits and the output has 2-digits and the resulting 2-digit output does not yield the same results when read in again.

For instance, suppose your input is 01/01/1927 and the cutoff year is 50. Normally any 2-digit year with a value less than 50 is considered part of the current century. So if the system outputs the data as 01/01/27 and then tries to read this date back in, you would get 01/01/2025 and not 01/01/1927.

The system changes its normal behavior because it is designed to be able to read its own output and come up with the result originally provided in the original input.

If, however, you specifically tell the system you only want two digits, you will get that output, but the system may not be able to read it back in and get the same results.