10 Replies Latest reply: Nov 27, 2016 3:32 PM by Marco Wedel

# turn the number into hh: mm: ss (10:37:29)

Hi Community,

I wish to turn the number 103729 into hh: mm: ss (10:37:29).

My I do it? And howto?

• ###### Re: turn the number into hh: mm: ss (10:37:29)

Try this

Time(Time#(TimeStr,'HHMMSS'),'hh:mm:ss')

• ###### Re: turn the number into hh: mm: ss (10:37:29)

'HHMMSS'

Using upper case MM (Month) will give some funny results.

-Rob

• ###### Re: turn the number into hh: mm: ss (10:37:29)

Thanks it should be always.

Time(Time#(TimeStr,'hhmmss'),'hh:mm:ss')

But need to check correct time format.

Regards,

Anand

• ###### Re: turn the number into hh: mm: ss (10:37:29)

hi

you can do something like this

num(left(YOURFIELD,2))/24+num(mid(YOURFIELD,3,2))/1440+num(right(YOURFIELD,2))/86400

• ###### Re: turn the number into hh: mm: ss (10:37:29)

try

timestamp(timestamp#(Fieldname,'hhmmss'),'hh:mm:ss')

• ###### Re: turn the number into hh: mm: ss (10:37:29)

In Script...

Time(Time#(YourTimeField,'hhmmss')) as YourTimeField

Front End

Time(Time#(YourTimeField,'hhmmss'))

• ###### Re: turn the number into hh: mm: ss (10:37:29)

You can try this also

MakeTime(LEFT(TimeStr,2),mid(TimeStr,2,2),Right(TimeStr,2) ) as MakeNewtime;

[

TimeStr

103729

];

Maketime represents

Maketime (Hour, Minutes, Seconds)

Regards

Anand

• ###### Re: turn the number into hh: mm: ss (10:37:29)

Hi,

in case you have 5 digit values for times earlier than 10, this might helps as well:

```LOAD *,
Time(Time#(Num(number,'000000'),'hhmmss')) as numberTime
Inline [
number
01234
12345
012346
90123
090124
103729
123456
134556
235959
];
```

regards

Marco

• ###### Re: turn the number into hh: mm: ss (10:37:29)

Dear,

And one of this the correct one also

MakeTime(Left(TimeStr,2),Mid(TimeStr,3,2),Right(TimeStr,2) ) as MakeNewtime,

Left(TimeStr,2) as Hours,

Mid(TimeStr,3,2) as Minutes,

Right(TimeStr,2) as Seconds;

[

TimeStr

103729

];

Regards,

Anand

• ###### Re: turn the number into hh: mm: ss (10:37:29)

Good to see that some answers helped you.

Qlik Community Tip: Marking Replies as Correct or Helpful

thanks

regards

Marco