Forum Discussion

Martijn2's avatar
Martijn2
Frequent Visitor
1 year ago
Solved

Time registration as 330 while 03:30:00 is needed

  Hello all, Anyone tips on how I can get this timestamp to for example 03:30:00? 101 = 1:01 10:10 = 1010      
  • BeaBF's avatar
    BeaBF
    1 year ago

    Martijn2 ok, try to put this code in a custom column:

    let
    TidAsText = Text.From([Tijd]),
    TidLength = Text.Length(TidAsText),
    Result =
    if TidLength = 1 then
    Time.FromText("0" & TidAsText & ":00:00")
    else if TidLength = 2 then
    Time.FromText("00:" & TidAsText & ":00")
    else if TidLength = 3 then
    Time.FromText("0" & Text.Start(TidAsText, 1) & ":" & Text.End(TidAsText, 2) & ":00")
    else
    Time.FromText(Text.Start(TidAsText, 2) & ":" & Text.End(TidAsText, 2) & ":00")
    in
    Result

     

     

     

    BBF