Function Block MKTIME

This Function Block MKTIME converts individual date and time values into the DT# format.

The function block is the opposite of GETTIME.

Note: To calculate a date before the year 1970, the Function Block STR2DT is recommended.

Input YEAR

The year number, which can be specified as two or four digits. Values from 0 to 69 are transferred to 2000-2069, values from 70 to 100 to 1970-2000.

Input MONTH

The number of the month relative to the end of the previous year. The values 1 to 12 refer to normal calendar months of the respective year. Values less than 1 (including negative values) refer to the months of the previous year in reverse order, so that 0 is December, -1 November, etc. Values greater than 12 refer to the corresponding month of the following year(s).

If the input is NULL or an empty string, then 1 is assumed.

Input DAY

The number of the day relative to the end of the previous month. The values 1 to 28, 29, 30 or 31 (depending on the month) refer to normal days in the current month. Values less than 1 (including negative values) refer to the days of the previous month, so that 0 is the last day of the previous month, -1 the second-to-last, etc. Values greater than the number of days in the current month refer to the corresponding day in the following month(s).

If the input is NULL or an empty string, then 1 is assumed.

Input HOUR

The number of hours relative to the beginning of the day determined by MONTH, DAY and YEAR. Negative values refer to the hour before midnight of the respective day. Values greater than 23 refer to the corresponding hour of the following day(s).

Input MINUTE

The number of minutes relative to the beginning of HOUR. Negative values refer to the minute in the previous hour. Values greater than 59 refer to the corresponding minute of the following hour(s).

Input SECOUND

The number of seconds relative to the beginning of MINUTE. Negative values refer to the second in the previous minute. Values greater than 59 refer to the corresponding second of the following minute(s).

Input MILISEC

The number of milliseconds relative to the beginning of SECOUND. Negative values refer to the millisecond in the previous second. Values greater than 999 refer to the corresponding millisecond of the following second(s).

Output DT

The output returns the calculated value as date and time in DT# format.