|
I threw this code together yesterday. It seems to work okay. The one place I know that it will not display properly is if there are minutes but no seconds (i.e. PT2M, but will work if PT2M0S).
stringvar tempvar; if {timedata_txt.Time} startswith "0" then tempvar := mid({timedata_txt.Time},6,5) else (if instr({timedata_txt.Time},"M") <>0 then if isnumeric(mid({timedata_txt.Time},4,1)) then tempvar := mid({timedata_txt.Time},3,2)+":" else tempvar := "0"+ mid({timedata_txt.Time},3,1)+":" else tempvar := "00:"; if instr({timedata_txt.Time},"S") <>0 then if isnumeric(mid({timedata_txt.Time},len({timedata_txt.Time})-2,1)) then tempvar := tempvar + mid({timedata_txt.Time},len({timedata_txt.Time})-2,2) else tempvar := tempvar + "0"+mid({timedata_txt.Time},len({timedata_txt.Time})-1,1)); "00:"+tempvar
|