8 Replies Latest reply: Aug 1, 2018 8:59 AM by Sunny Talwar

# Time format (hhmmss) shown wrong

Hi all,

I have a matrix which looks like this:

Carton IDScan Date Scan Time
17690011051122018051181958

In the  "Data load editor" I added the following

The result for the Date is correct, but unfortunately the time is wrong. It should be 08:19:58 (hh:mm:ss)

Much obliged

• ###### Re: Time format (hhmmss) shown wrong

Try this (use single h instead of 2)

Time(Time#(TPROA, 'hmmss')) as [Time-scan-return-carton]

• ###### Re: Time format (hhmmss) shown wrong

Hi Sunny,

unfortunately scan time can be

81920 = 08:19:20 as well as

182130 = 19:21:30 (which are now not shown correctly)

• ###### Re: Time format (hhmmss) shown wrong

I think sunil might have meant this...

Table:

Time(Time#(TPROA, If(Len(Trim(TPROA)) = 5, 'hmmss', 'hhmmss'))) as [Time-scan-return-carton];

LOAD * Inline [

TPROA

81920

182130

];

The above seems to work

• ###### Re: Time format (hhmmss) shown wrong

can you try this

Time(Time#(If(len(TPROA)>5, 'hhmmss','hmmss'))) as [Time-scan-return-carton]

• ###### Re: Time format (hhmmss) shown wrong

Hi Sunil,

I like your approach, but it didn't work.

here is the sample

Anything else?

• ###### Re: Time format (hhmmss) shown wrong

Did you try this?

Table:

Time(Time#(TPROA, If(Len(Trim(TPROA)) = 5, 'hmmss', 'hhmmss'))) as [Time-scan-return-carton];

LOAD * Inline [

TPROA

81920

182130

];

• ###### Re: Time format (hhmmss) shown wrong

Try this, it should work

=Time(Timestamp#(81920,'hmmss'))