Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function module for comparing dates and times

Former Member
0 Likes
3,135

Hi,

I have a date and time stamp in one filed for example as below:

20070125183045

(the first 8 are date in YYYYMMDD format, the next 6 is time in HHMMSS format). Now I want to compare this value to another such value in terms of date and time. First I want to compare dates and then times. Do you know any function module that can serve this purpose?

Thanks very much!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,430

CCU_TIMESTAMP_DIFFERENCE

here you can use it as timestamp itself. no need to split to time and date.

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,430

You can compare these using the function module DURATION_DETERMINE. This fuction will give you the difference, and it can be in a view different units, such as the difference in days, months, etc.

Funciton module takes in Start date and time and end date and time.

Regards,

RIch HEilman

Read only

Former Member
0 Likes
1,430

Use Offset or SPLIT and then compare.

Regards,

Amey

Read only

ferry_lianto
Active Contributor
0 Likes
1,430

Hi Krishen,

Please check this FM.

SD_DATETIME_DIFFERENCE

SD_CALC_DURATION_FROM_DATETIME

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,431

CCU_TIMESTAMP_DIFFERENCE

here you can use it as timestamp itself. no need to split to time and date.