09-01-2022 3:02 PM
Hi all,
Suppose that I have two timestamps, e.g., 20220901225421 and 20220830221056, I want to get how many days between these two date.
The logic is simple, just make it 20220901000000 and 20220830000000, so the interval should be 2 days.
Is there any function or class that I can use?
Regards,
Eric
09-01-2022 3:03 PM
09-01-2022 4:51 PM
You can take the first 8 characters of each information and do a simple subtraction to return the difference
days = dat_1 - dat_2.
Or you can use the cl_abap_tstmp=>subtract method which will return the difference in seconds