Application Development 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: 

Adding Hours to Current Date and Current Time

former_member609120
Contributor
0 Kudos

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

kesavadas_thekkillath
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

Hi,

You can use FM - C14B_ADD_TIME

Nag

Former Member
0 Kudos

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

Rob