Business Process Automation

Date Instructions

Each business number rule has a rule definition. Rule definitions contain the instructions that the Business Number Generator (BNG) uses to create the sequence of numbers, letters, and other characters that comprise business number types. This is entered in the Rule Definition field in the Business Number Rule page.

Date instructions specify rule definitions that include date sequences in various formats. In date instructions, date sequences are indicated by the letter " d". The date itself will always be the date on which the business number is generated, but the format of the date depends on the instruction.

Number-only Dates

As the following table shows, the simplest way to specify a date sequence is to create an instruction comprised solely of " d's". The generated date sequence will contain numbers only. The number of " d's" determines its format.

Date Sequence

Date Format

{d}

The day of the month.  (1,..., 31).

{dd}

The zero-padded day of the month (01, 02,..., 31).

{dddd}

The zero-padded month number, followed by the zero-padded day of the month (0101,...,1231).

{dddddd}

The two-digit year, followed by the zero-padded month number and the zero-padded day of the month (990101, 990102,...).

{dddddddd}

The four-digit year followed by the month and date (19990101, 19990102,...).

Dates with Non-numeric Characters

To specify more sophisticated date sequences (for example, sequences including letters) use the picture argument in the instruction, with this structure and syntax:

{ d*: picture="date format"}

The d* indicates a date sequence of variable length. The double quotation marks around the date format are required.

You specify the date format with a picture argument by using the date symbols described in the following table. Note that the meaning of some date symbols depends on whether they are upper or lower case.

Date Symbol

Meaning

Character Type

Example or Series

G

era

text

BC, AD

y

year

number

2007

M

month

text and number

January,..., December. Or 01,..., 12

Three or more M's specify a text format (for example, Jan or January). One or two M's specify the number format.

d

day in month

number

1,..., 31

h

hour ( a.m./ p.m. style)

number

1,..., 12

H

hour (military style)

number

0,..., 23

m

minute

number

0,..., 59

s

second

number

0,..., 59

S

millisecond

number

000,..., 999

E

day of week

text

Monday,..., Sunday

D

day in year

number

1,..., 364/365

F

day of week in month

number

3 (This number represents the number of times a weekday has occurred within the month. The third Tuesday in the month would be a 3.)

w

week in year

number

1,..., 52

W

week in month

number

1,..., 4/5

a

a.m./ p.m.

text

AM, PM

k

hour (military style)

number

1,..., 24

K

hour ( a.m./ p.m. style)

number

0,..., 11

z

time zone

text

Pacific Standard

''

single quote

text

'

 

Here are sample date instructions, with the sequences they would generate, using the picture argument:.

  • { d*: picture=yy/MM/dd} generates 07/01/01, 07/01/02,....
  • { d*: picture=MMM dd, '' yy} generates Jan 01 '07, Jan 02 '07,....
  • { d*: picture=MMMM dd, yyyy, hh.mm.ss a zzz" generates Jan 01 2007, 01.01.01 a.m. EST,....

Note: In date instructions with picture arguments, include four or more text date symbols to indicate the full date format, four or less text date symbols for an abbreviated format, if available. For example, yyyy generates 2007 and yy generates 07.

For number date symbols, include the minimum number of digits for the sequence. Shorter numbers will be zero-padded to the left. Characters other than date symbols in the date format will appear in the generated business numbers as literal text.

Related Topics