Please enable JavaScript to view this site.

This program will take a date string in a specified format and pass it back in a different specified format. This is particularly useful in converting dates printed on a spooled file into the Cobwebb Docstore format of YYYY-MM-DD.

Parameter

In

Len

Out

Len

PARM1

Input Date String

50

Output Date String

50

PARM2

Input Date Format (optional)

7

-

 

PARM3

Output Date Format (optional)

50

-

 

PARM4

-

 

-

 

PARM5

-

 

-

 

PARM6

-

 

-

 

Note:

If no Input Date Format is specified then *DMY [DD/MM/YY] is assumed.

If no Output Date Format is specified then %Y-%m-%d {YYYY-MM-DD] is assumed which is the required format for Cobwebb Docstore.

Input Date Format string

Specifies the current format of the Input Date String to be converted. All valid date separators will be removed automatically before converting. The valid date separators are the slash (/), hyphen (-), period (.), and comma (,).

Format Code

Description

*MDY

The date has the month, day, year format, mmddyy.

*MDYY

The date has the month, day, year format, mmddyyyy.

*DMY

The date has the day, month, year format, ddmmyy.

*DMYY

The date has the day, month, year format, ddmmyyyy.

*YMD

The date has the year, month, day format, yymmdd.

*YYMD

The date has the year, month, day format, yyyymmdd.

*CYMD

The date has the century, year, month, day format, cyymmdd, where c is 0 for years 1928 through 1999 and is 1 for years 2000 through 2071.

*JUL

The date has the Julian format, yyddd.

*ISO

The date has the International Organization for Standardization (ISO) date format, yyyy-mm-dd.

*USA

The date has the United States date format, mm/dd/yyyy.

*EUR

The date has the European date format, dd.mm.yyyy.

*JIS

The date has the Japanese Industrial Standard date format, yyyy-mm-dd.

*LONGJUL

The date has the long Julian format, yyyyddd.

Example Input Date Format

If your input date is in the format mm/dd/yy you would specify *MDY as your Input Date Format in PARM2

Output Date Format string

These can be any character string value with embedded format codes. The format codes are translated into their corresponding values. These format codes and their corresponding values are listed in the table that follows.

Format Code

Description

%a

Abbreviated weekday name: 'Tue", "Wed", etc.

%A

Full weekday name: "Tuesday", "Wednesday", etc.

%b

Abbreviated month name: "Jan", "Feb", etc.

%B

Full month name: "January", "February", etc.

%d

Day of the month as a decimal (01 to 31)

%j

Day of the year as a decimal (001 to 366)

%m

Month as a decimal number (01 to 12)

%U

Week as a decimal number: Sunday base (00 to 53)

%w

Weekday as a decimal number with Sunday base (0 to 6)

%W

Week as a decimal number with Monday base (00 to 53)

%x

Date edited for local system.

%y

Year without century (2-digit year) (00 to 99)

%Y

Year with century (4-digit year)

%%

Embed a percent sign into the string.

Example Output Date Format

If you wanted your output date to be in the format Friday 29 February 2008 then you would specify %A %d %B %Y as your Output Date Format in PARM3.