yomango

Adding a number to a time variable to produce a new time

Discussion created by yomango on May 26, 2017
Latest reply on May 27, 2017 by TomHays

Hello. A quick question: I need to convert pm time to military time. For instance, I have a 12:30pm, want to add 5 hours to produce a 17:30 or I have a 5:30 and need the outcome to show 17:30. Some fine soul gave me a script that ALMOST works, except for PM. It works with full hours, no minutes. 1pm, get a 13:00 and so on. But 6:30pm gets a 617:00. One more note, if the time variable shows 6.30 the result is 18.3:00, but I haven't been able to substitute the resulting period(.)  with the colon(:) sign. The calculation for pm looks similar to this: conv= (Case... pm=1; num+12&:00) where "num" is the variable time itself, without the "pm" text.

Outcomes