You are here: Adding Section and Field Rules > Formatting Data > Setting Up Format Arguments

Setting Up Format Arguments

The FmtDate, RunDate, SysDate, and FmtTime rules let you design the format of the output. You tell the system how to format the output using format arguments. Format arguments consists of one or more codes, separated by a percent sign (%).

Characters that do not begin with a percent sign are copied unchanged to the output buffer. This lets you include static text. Any character following a percent sign that is not a format code is copied unchanged to the destination. For example, to include a percent sign in the output, add two percent signs (%%).

You can enter up to 80 characters in the mask and you can use these format codes:

Code

Description

%A

Name of the weekday, such as Tuesday

%w

Number of the weekday, (Sunday is 1, Saturday is 7)

%b

Month abbreviation, such as Mar

%m

Month number, (January is 1, December is 12)

%B

Month name, such as November

%d

Number of the day of the month (01 – 31)

%j

Number of the day of the year (001 – 366)

%Y

Year with the century, such as 2014

%y

Year without the century, such as 13

%H

Hour in 24-hour format (00 – 23)

%I

Hour in 12-hour format (01 – 12)

%M

Minute (00 – 59)

%S

Second (00 – 59)

%p

Current locale's AM/PM indicator for 12-hour clock

%@xxx

xxx identifies the locale. For example, %@CAD%A might produce mardi, the Canadian French word for Tuesday. The default locale is USD, which is US English. Once it finds a local format, the system uses that locale until it finds another locale indicator.

#

Suppress leading zeros for the following format codes. The system recognizes this flag only with these formats:

%#d, %#H, %#I, %#j, %#m, %#M, %#S, %#w

>

Uppercase the resulting text. The system recognizes this flag only with these formats:

%>p, %>A, %>b, %>B

<

Lowercase the resulting text. The system recognizes this flag only with these formats:

%<p, %<A, %<b, %<B

<>

Capitalize the first letter of the resulting text. The system recognizes this flag only with these formats:

%<>p, %<>A, %<>b, %<>B

* - This flag only affects the format code that specifies it. Any subsequent codes that have text are not affected unless they also include the flag.

Inputting Information

Keep in mind the system can only work with the information it receives as input.

The formats for week, hour, minute, AM, and PM (%A,%w,%H,%I,%M,%S, %p) are useful with the SysDate and FmtTime rules, but do not make sense for RunDate and FmtDate rules since those rules seldom see week or time information as an input.

Furthermore, you would not want to use the zero suppress format option (#) on input—especially if there are no separators in the data. For instance, the date indicated by 010109 or 1/1/09 is clear, but 1109 could indicate several things.

For example, assume the date is 03-01-2009, which was a Monday, and the time is 11:57 am. This table shows you results using various formats.

Example

Output

%m-%d-%Y

03-01-2009

The year is %Y.

The year is 2009.

Born %m/%d/%y at %I:%M %p

Born 03/01/09 at 11:57 AM

%d

01

%#d

1

%A

Monday

%>A

MONDAY

%b

Mar

%<b

mar

%p

AM

%<>p

Am

 

Monday, March 01

%@CAD%A %@CAD%A, %B %d

lundi, mars 01

%A, %@CAD%B %d

Monday, mars 01

%@CAD%A, %@USD%B %d

lundi, March 01