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

Time Subtract

Former Member
0 Likes
1,005

Hello.

How can i subtract time from any given date/time?

Thank you.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
853

Hi

You can use FM <b>C14Z_CALC_DATE_TIME</b>

Inputs

<b>Seconds</b> (In your case -ve, as you want to substract time)

<b>Time</b>

<b>Date</b>

Regards,

Raj

5 REPLIES 5
Read only

Former Member
0 Likes
853

hi,

Check the fm SD_DATETIME_DIFFERENCE or GET_DELTA_TIME_FROM_DT

Check Rich post in this thread to know how to use fm <b>GET_DELTA_TIME_FROM_DT</b>

Regards,

Sailaja.

Message was edited by: Sailaja N.L.

Read only

Former Member
0 Likes
854

Hi

You can use FM <b>C14Z_CALC_DATE_TIME</b>

Inputs

<b>Seconds</b> (In your case -ve, as you want to substract time)

<b>Time</b>

<b>Date</b>

Regards,

Raj

Read only

0 Likes
853

Hello,

What i need is not the difference bettwen 2 date/time. I need to subtract for example an hour from a date/time and get the result.

C14Z_CALC_DATE_TIME adds seconds without a problem but it work with negative seconds.

Thank you

Nuno Silva

Read only

0 Likes
853

try TIMESTAMP_DURATION_SUB.

~Suresh

Read only

Former Member
0 Likes
853

hi,

You can subtract time directly, there is no need of FM.


data: v_time type t value '201010'.

v_time = v_time - 600.  "10min (10*60 = 600 seconds)
write :/ v_time.

Regards,

Sailaja.