Date/time arithmetic in CL can be a chore. Command CHGDTETME allows flexible and easy CL date/time arithmetic.

Want yesterday's date? Simple:
CHGDTETME DTETME(*CURRENT) DURATION(*SUB *DAY) RTNVAL(&RESULT)

Or the date a month from now:
CHGDTETME DTETME(*CURRENT) DURATION(*ADD *MONTH) RTNVAL(&RESULT)

Or a week ago:
CHGDTETME DTETME(*CURRENT) DURATION(*SUB *WEEK) RTNVAL(&RESULT)

In addition to special values, Duration can be any combination of year, month, day, hours, minutes, and seconds:

YYYY-MM-DD-HH.MM.SS

Each segment can range from all zeros to all nines. For example a Duration of 0001-00-01-00.10.00 is a year, a day, and ten minutes. The only limitation is that the result date (RTNVAL) must fall between January 1, 0001 and January 1, 10000.

The base timestamp (DTETME) can be any valid timestamp value in YYYY-MM-DD-HH.MM.SS format.

DTETME, DURATION, and RTNVAL are CHAR(19) CL variables.

The calculations are performed by built-in functions.

Project Activity

See All Activity >

License

MIT License

Follow IBM/i CL date arithmetic

IBM/i CL date arithmetic Web Site

nel_h2
Simply solve complex auth. Easy for devs to set up. Easy for non-devs to use. Icon
Simply solve complex auth. Easy for devs to set up. Easy for non-devs to use.

Transform user access with Frontegg CIAM: login box, SSO, MFA, multi-tenancy, and 99.99% uptime.

Custom auth drains 25% of dev time and risks 62% more breaches, stalling enterprise deals. Frontegg platform delivers a simple login box, seamless authentication (SSO, MFA, passwordless), robust multi-tenancy, and a customizable Admin Portal. Integrate fast with the React SDK, meet compliance needs, and focus on innovation.
Start for Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of IBM/i CL date arithmetic!

Additional Project Details

Operating Systems

IBM i

Intended Audience

Developers

Registered

2021-03-25