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 milliseconds to long date format (tzntstmpl)

Former Member
0 Kudos

I have a date field called START_DATE defined as type TZNTSTMPL (long date/time format - YYYYMMDDHHMMSS.mmmuuun) and another field call MILLISECONDS also defined as type TZNTSTMPL.

I want to subtract 625 milliseconds from START_DATE, so I put .625 in the MILLISECONDS field and subtract MILLISECONDS from START_DATE.

The starting value in START_DATE is "20090701095000.5410000". After I subtract MILLISECONDS from START_DATE the result is "20090701094999.9160000".

The result should have been "20090701094959.9160000. The problem is with SS (Seconds) 99 is invalid.

How can I get it to subtract correctly?

Are there any ADD or SUBTRACT functions that work with the long date/time format?

Regards,

Mike...

1 ACCEPTED SOLUTION

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

Can you check class cl_abap_tstmp method subtractsecs and SUBTRACT?

Regards,

Vinod.

2 REPLIES 2

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

Can you check class cl_abap_tstmp method subtractsecs and SUBTRACT?

Regards,

Vinod.

0 Kudos

Vindo,

Thanks that is exactly what I was looking for. It handled the adding and subtract from the long date format correctly.

Regards,

Mike...