Convert Date to Lilian Format (CEEDAYS) API


  Required Parameter Group:


  Omissible Parameter:


  Service Program Name: QLEAWI

  Default Public Authority: *USE

  Threadsafe: Yes

The Convert Date to Lilian Format (CEEDAYS) API converts a string representing a date into a number representing the number of days since 14 October 1582. This API makes it easier to do calculations such as the number of days between two dates.


Authorities and Locks

None.


Required Parameter Group

input_char_date (input by descriptor)
A character string representing a date or timestamp in the format shown by picture_string. Field width is 5 to 255 characters. Input-char-date can contain leading or trailing blanks. Parsing for a date begins with the first non-blank character unless the picture string contains leading blanks, in which case CEEDAYS skips exactly that many positions before parsing begins. After a valid date is parsed, remaining characters are ignored. Valid dates are in the range 15 October 1582 to 31 December 9999.

picture_string (input by descriptor)
A character string indicating the format of the date value in input_char_date, for example MM/DD/YY. Each character in picture_string represents a character in input_char_date. If delimiters such as the slash (/) appear in the picture string, then leading zeros can be omitted. For example:
CALL CEEDAYS('6/2/88'  , 'MM/DD/YY', lildate, fc);
CALL CEEDAYS('06/02/88', 'MM/DD/YY', lildate, fc);
CALL CEEDAYS('060288'  , 'MMDDYY'  , lildate, fc);
CALL CEEDAYS('88154'   , 'YYDDD'   , lildate, fc);
would all assign the same value to variable lildate. If any time characters are included, for example HH:MI:SS YY/MM/DD, they count as place holders but are otherwise ignored.

Picture Characters Used in Picture Strings contains a list of valid picture characters, and Examples of Picture Strings Recognized by ILE Date and Time APIs has examples of valid picture strings.

If picture_string is null or blank, CEEDAYS obtains picture_string based on the current job value for the country or region ID (CNTRYID). For example, if the current value for CNTRYID is US (United States), the date format is MM/DD/YY. If the current job value for CNTRYID is FR (France), the date format is DD.MM.YYYY.

This default mechanism makes it easy for translators to specify the preferred date format, and also easy for application programs and library procedures to automatically use this format.

output_Lilian_date (output)
A 32-bit binary integer representing the Lilian date, which is the number of days since 14 October 1582. For example, 16 May 1988 is day number 148 138. If input_char_date does not contain a valid date, output_Lilian_date is set to 0 and CEEDAYS ends with a nonzero feedback code.

Omissible Parameter

fc (output)
A 12-byte feedback code passed by reference. If specified as an argument, feedback information (a condition token) is returned to the calling procedure. If not specified and the requested operation was not successfully completed, the condition is signaled to the condition manager.

Feedback Codes and Conditions


Usage Notes


Picture Characters Used in Picture Strings



Examples of Picture Strings Recognized by ILE Date and Time APIs



Japanese Eras Used by ILE Date and Time APIs When <JJJJ> Specified

Start of change End of change

Republic of China Eras Used by ILE Date and Time APIs When <CCCC> or <CCCCCCCC> Specified


Example



API introduced: V2R3

[ Back to top | ILE CEE APIs | APIs by category ]