Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
chiru_thota
Specialist
Specialist

Time from from 12 hours format to 245 hours format

Hi all,

I have one column with some values in 12 hours format and others in 24 hours format.

I want them to convert into 24 hours format. Can you suggest the right function ?

10:56:36 AM
10:56:37 AM
10:56:38 AM
10:56:39 AM
10:56:40 AM
10:56:41 AM
13:31:24
13:31:25
13:31:27
13:31:28
13:31:32
13:31:36
13:31:37

Thanks,

Chiru

1 Solution

Accepted Solutions
Not applicable

How about this:

if(wildmatch(DateField,'*AM','*PM'),Date(Date#(DateField,'hh:mm:ss TT'),'hh:mm:ss'),Date(Date#(DateField,'hh:mm:ss'),'hh:mm:ss'))

See attached example.

Thanks

AJ

View solution in original post

2 Replies
Not applicable

How about this:

if(wildmatch(DateField,'*AM','*PM'),Date(Date#(DateField,'hh:mm:ss TT'),'hh:mm:ss'),Date(Date#(DateField,'hh:mm:ss'),'hh:mm:ss'))

See attached example.

Thanks

AJ

maxgro
MVP
MVP

load

alt(date(date#(dim, 'hh:mm:ss'), 'hh:mm:ss'), date(date#(dim, 'hh:mm:ss TT'), 'hh:mm:ss')) as dim;

//if(left(dim,2)>12,

// date(date#(dim, 'hh:mm:ss'), 'hh:mm:ss'),

// date(date#(dim, 'hh:mm:ss TT'), 'hh:mm:ss')

// ) as dim;

load * inline  [

dim

10:56:36 PM

10:56:36 AM

10:56:37 AM

10:56:38 AM

10:56:39 AM

10:56:40 AM

10:56:41 AM

13:31:24

13:31:25

13:31:27

13:31:28

13:31:32

13:31:36

13:31:37

];