Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

I have a problem with converting format date and time

Hello and Welcome,

 

I am facing a problem with a formatting date and time , I am fetching this column form local html page and it gives me a column with this format : Friday, May 1, 2020 1:46:06 AM

I tried to do this : 

Timestamp#("Last connection", 'WWWW, MMMM d, yyyy h:mm:ss TT') ,it shows  on qlik table but I can apply filter year , month and day on this.

please help 😞

Labels (1)
1 Solution

Accepted Solutions
Contributor II
Contributor II

Thank you very much for replying  and supporting, I tried but it didn't work.

 

I figured out something and works with me . I separated them individually using subfield and I used the timpstamp to rejoin them. and it works .

in load I add a new column as the following:

Timestamp#(subfield(subfield("Last connection", ',', 2), ' ', 3) &'-' & subfield(subfield("Last connection", ',', 2), ' ', 2) &'-'& subfield(subfield("Last connection", ',', 3) , ' ', 2)
&' '& subfield(subfield("Last connection", ',', 3) , ' ', 3) &' '& subfield(subfield("Last connection", ',', 3), ' ', 4),'dd-MMM-yyyy hh:mm:ss tt') as date_and_time.

 

 

View solution in original post

2 Replies
MVP & Luminary
MVP & Luminary

Hi,

I think the main problem is that D for days and YYYY for years need to be specified in upper case. Lower case letters are used for hours, minutes, and seconds:

Timestamp#("Last connection", 'WWWW, MMMM D, YYYY h:mm:ss TT')

Also, check the data for April, to make sure that you need the full month name (MMMM) and not just a 3-letter month (MMM).

Cheers,

Contributor II
Contributor II

Thank you very much for replying  and supporting, I tried but it didn't work.

 

I figured out something and works with me . I separated them individually using subfield and I used the timpstamp to rejoin them. and it works .

in load I add a new column as the following:

Timestamp#(subfield(subfield("Last connection", ',', 2), ' ', 3) &'-' & subfield(subfield("Last connection", ',', 2), ' ', 2) &'-'& subfield(subfield("Last connection", ',', 3) , ' ', 2)
&' '& subfield(subfield("Last connection", ',', 3) , ' ', 3) &' '& subfield(subfield("Last connection", ',', 3), ' ', 4),'dd-MMM-yyyy hh:mm:ss tt') as date_and_time.

 

 

View solution in original post