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

Adding Hours to Current Date and Current Time

former_member609120
Contributor
0 Likes
3,888

My Requirement is that i need to add/subtract hours to current date and current time and then display the same..Incase of time its fine, but for date if goes to the next day i need to add 1 to date.

Example:

Current Time is 11pm

Current Date is 12.03.2010

I want to add 3 hrs

So Time will become 2am

But Date needs to become 13.03.2010

Can anyone suggest any SAP Standard Function modules to do the same?

Thanks and Regards,

Vanessa

3 REPLIES 3
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,415

You can check class CL_ABAP_TSTMP method ADD.

Here you can add seconds to the time stamp, so convert to seconds and then add it.

Read only

Former Member
0 Likes
1,415

Hi,

You can use FM - C14B_ADD_TIME

Nag

Read only

Former Member
0 Likes
1,415

Please do not ask date/time questions that have been answered many times before - locked.

Rob