Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
davyqliks
Specialist
Specialist

Date format conversion

Hi,

Happy New Year!

I have  to convert the following date format to standard HH/MM/SS .

My issue is i am unfamiliar with the meaning and how to write the date conversion for the .000000 part of the date format below

2021-08-30 13:00:13.000000

I would use like below:

Date(Date#(admin_added,'YYYY-MM-DD HH:MM:SS'),'DD/MM/YYYY') AS [Date Added],

 

but get no return due to me not adding the end of the received format .000000

 

PLease can anyone assist?

 

Thank you

Labels (3)
1 Solution

Accepted Solutions
anat
Master
Master

can you try like:

date(floor(admin_added),'DD/MM/YYYY') as [Date Added]

View solution in original post

4 Replies
tresesco
MVP
MVP

You could interpret the additional digits as fraction of second  with 'f'. Try like:

Date(Date#(admin_added,'YYYY-MM-DD HH:mm:SS.ffffff'),'DD/MM/YYYY') AS [Date Added],

anat
Master
Master

can you try like:

date(floor(admin_added),'DD/MM/YYYY') as [Date Added]

_Gerardo_
Partner - Contributor III
Partner - Contributor III

The formula you need is the one from Anat's reply.

Using Floor() function you are effectively removing decimal part for your DateTime value.

 

For example, for this value --->>>> 44568.010393519

the integer for this number converted to date will be  1/7/2022

the decimal part for the same number converted to time will be 12:14:58 AM

the whole number will be shown as 1/7/2022 12:14:58 AM

davyqliks
Specialist
Specialist
Author

thank you, this is perfect.

Daniel