Reading date data in the format determined automatically by DataMagic

Below we explain the character data formats that can be input to the date type (type D). Information in this section applies when you do not specify input date formats in the Options tab.

The output date type is set in Output format of the Mapping Information Settings. If you do not set the format, the format is YYYY/MM/DD.

(1) Delimiter

For the delimiter that separates the year, month, and day (the date delimiter), you can use a slash (/), minus sign (-) or period (.). The table below lists the patterns that you can set as formats. Any other formats will result in a conversion error.

Table 4.23 Date delimiter formats (assuming a data processing start date of October 1, 2007) (#1)

Pattern

Example

Input string

Value of type D

Month/Day

1/2

2007/01/02 00:00:00

Month.Day

1.2

2007/01/02 00:00:00

Year (2 digits)-Month-Day

01-2-3

2001/02/03 00:00:00(#2)

Month/Day/Year (2 digits)

2/1/03

2003/02/01 00:00:00(#2)(#3)

Month.Day.Year (2 digits)

2.1.03

2003/02/01 00:00:00(#2)(#3)

Year (4 digits)-Month-Day

2001-2-3

2001/02/03 00:00:00

Year (4 digits)/Month/Day

2001/2/3

2001/02/03 00:00:00

Year (4 digits).Month.Day

2001.2.3

2001/02/03 00:00:00

Japanese era and calendar year (abbreviation)-Month-Day

H1-2-3

1989/02/03 00:00:00

Japanese era and calendar year (abbreviation)/Month/Day

H1/2/3

1989/02/03 00:00:00

Japanese era and calendar year (abbreviation).Month.Day

H1.2.3

1989/02/03 00:00:00

#1

:

Any year, month, or day for which the number of digits is not specified can be input as a one- or two-digit value.

#2

:

Year values of 69 or higher are regarded as years in the 1900s, and year values of 68 or lower are regarded as years in the 2000s.

#3

:

This date is interpreted in the American format of MM/DD/YY.

 

As the delimiter that separates hour, minute, and second (the time delimiter), you can use a colon (:). The table below lists the specifiable formats. Any other formats will result in a conversion error.

Table 4.24 Time delimiter formats (assuming a data processing start date of October 1, 2007)

Pattern

Example

Input string

Value of type D

Hour:Minute

12:34

2007/10/01 12:34:00

Hour:Minute:Second

12:34:56

2007/10/01 12:34:56

= Remarks =

When you specify both the date and time at the same time, use a halfwidth or fullwidth space to separate the date and time parts.

If you omit date delimiters and time delimiters to specify a date and time by using only numbers, depending on the number of digits, the dates and times are interpreted as described below.

Table 4.25 Date data without delimiter (assuming a data processing start date of October 1, 2007)

No. of digits

Interpretation

Example

Input string

Value of type D

1 to 2 digits

Time (1 to 2 digits)

1

2007/10/01 01:00:00

 

 

11

2007/10/01 11:00:00

3 to 4 digits

Time (1 to 2 digits) Minute (2 digits)

111

2007/10/01 01:11:00

 

 

1111

2007/10/01 11:11:00

5 digits

Conversion error

 

 

6 digits

Year (2 digits) Month (2 digits) Date (2 digits)

111111

2011/11/11 00:00:00

7 digits

Conversion error

 

 

8 digits

Year (4 digits) Month (2 digits) Date (2 digits)

11111111

1111/11/11 00:00:00

9 or more digits

Normal operation is not guaranteed.

 

 

(2) Carries to the upper unit of time

If the hours are 24 or more, or the months are 13 or more, or in similar situations, carries are produced to convert input values to correct dates and times.

Table 4.26 Examples of carries (assuming a data processing start date of October 1, 2007)

Input string

Value before carries

Value after carries

24

2007/10/01 24:00:00

2007/10/02 00:00:00

5555

2007/10/01 55:55:00

2007/10/03 07:55:00

55/55

2007/55/55 00:00:00

2011/08/24 00:00:00

(3) Japanese calendar formats

If inputting dates and times in a Japanese calendar format, use the formats below. If any other format is used, normal operation is not guaranteed.

Table 4.27 Japanese calendar formats that can be specified

Date

Time

Example

Year, month, and day

None

2007年10月26日

平成19年10月26日

Hour

2007年10月26日 12時

平成19年10月26日 12時

Hour and minute

2007年10月26日 12時30分

平成19年10月26日 12時30分

Hour, minute, and second

2007年10月26日 12時30分45秒

平成19年10月26日 12時30分45秒

Month and day

None

10月26日

Hour

10月26日 12時

Hour and minute

10月26日 12時30分

Hour, minute, and second

10月26日 12時30分45秒

= Remarks =

For DataMagic to support a Japanese era name that is more recent than 平成, it is necessary to specify the new Japanese era name in the Japanese era name (era_name) field of the system environment settings file (huledenv.conf).

(4) Date operations in output

If DataMagic determines date data automatically, it is possible to output the data after performing addition or subtraction on the input value. To do so, specify Formula on the Output Information Settings screen by using the operation symbols and measures of date (e.g. day, year), and select Date at Output format on the Set Mapping Information screen.

The input examples and the results of data operations are explained below.

Table 4.28 Examples of date operations (assuming a data processing start date and time (today) of October 1, 2007 at 12:34:56)

Input string

Value of type D

today

2007/10/01 12:34:56

today +10 hour

2007/10/01 22:34:56

today +1 day

2007/10/02 12:34:56

today 2month ago

2007/08/01 12:34:56

= Remarks =

For details about date operations, see DataMagic Reference Manual.