Both the COBOL date intrinsic functions and the Language Environment date callable services are based on the Gregorian calendar. However, the starting dates can differ depending on the setting of the INTDATE compiler option.
When INTDATE(LILIAN) is in effect, COBOL uses October 15, 1582 as day 1. Language Environment always uses October 15, 1582 as day 1. If you use INTDATE(LILIAN), you get equivalent results from COBOL intrinsic functions and Language Environment date callable services. The following table compares the results when INTDATE(LILIAN) is in effect.
| COBOL intrinsic function | Language Environment callable service | Results |
|---|---|---|
| DATE-OF-INTEGER | CEEDATE with picture string YYYYMMDD | Compatible |
| DAY-OF-INTEGER | CEEDATE with picture string YYYYDDD | Compatible |
| INTEGER-OF-DATE | CEEDAYS | Compatible |
| INTEGER-OF-DATE | CEECBLDY | Incompatible |
When the default setting of INTDATE(ANSI) is in effect, COBOL uses January 1, 1601 as day 1. The following table compares the results when INTDATE(ANSI) is in effect.
| COBOL intrinsic function | Language Environment callable service | Results |
|---|---|---|
| INTEGER-OF-DATE | CEECBLDY | Compatible |
| DATE-OF-INTEGER | CEEDATE with picture string YYYYMMDD | Incompatible |
| DAY-OF-INTEGER | CEEDATE with picture string YYYYDDD | Incompatible |
| INTEGER-OF-DATE | CEEDAYS | Incompatible |
related tasks
Using Language Environment callable services
related references
INTDATE