• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

E9.2 Time Calculate

I' need to find answer for following 2 issues. both are related to time. add time and reduce time, is there any BSFN to achieve these result.
1) How to add two hours
eg.
Input Output
1:00 1:00
13:00 14:00
1:30 15:30
1:30 17:00
2) How to reduce 30 min from time
eg.
Input Output
1:00 - 30MM = 30
 

eydeak

Reputable Poster
Hi,

I did a lot of searching on this subject a few years ago and found information on jdelist that helped me write some functions. You didn't say how you need to handle wrapping around midnight. You can probably adapt the attached code to handle your need.

Regards,
Ellen
 

Attachments

BOster

Legendary Poster
You may want to look into the UTC (jdeUTime) time APIs. Using jdeUTime_AdvanceTime you can roll the time foward/back like you want which should also handle the dates for you as well.
 

eydeak

Reputable Poster
Getting all time switched to utime would be great. A huge undertaking, but it would be a step in modernizing. When I was looking at functions I tried to find one where I could convert a standard JDE date and time field into a utime and vice versa and use the built in functions for adding/subtracting the utime fields. But, I couldn't find those so ended up writing something myself.
 
Hi,

I did a lot of searching on this subject a few years ago and found information on jdelist that helped me write some functions. You didn't say how you need to handle wrapping around midnight. You can probably adapt the attached code to handle your need.

Regards,
Ellen
Thank You!
 
Hi,

I did a lot of searching on this subject a few years ago and found information on jdelist that helped me write some functions. You didn't say how you need to handle wrapping around midnight. You can probably adapt the attached code to handle your need.

Regards,
Ellen
Ellen, After midnight I want time to add to previous day for eg. mnTimeIn_TRTM (1/1/2020) = 2300 and mnTimeToAdd_TRTM (1/2/2020) = 730 the mnTimeOut_TRTM should be 830 not the 3030
 
Top