cancel
Showing results for 
Search instead for 
Did you mean: 

time conversion

0 Kudos

Hello community ,

How to convert the hh:mm:ss time format to HH . rounding upto 2 decimals ,please suggest FM or programme.

thanks in advance

FredericGirod
Active Contributor
0 Kudos

COuld you clarify with an example?

Sandra_Rossi
Active Contributor
0 Kudos

Interview question?

Could you clarify what is HH format.

If you want to round at 2 decimals, I guess you'd like e.g. 23:30:00 to be converted into 23.50 ? (0.50 = half an hour)

matt
Active Contributor
0 Kudos

Basic maths.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Daniel,

Try with below code

DATA: lv_sec   TYPE tzntstmpl,
lv_hours TYPE p LENGTH 8 DECIMALS 2.

lv_sec = sy-uzeit. " Covert time HHMMSS format into Seconds
lv_hours = lv_sec / 3600. " Convert secnds into Hours

Answers (0)