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

How to Change Date Format if it's consider time

Hi 

How to change the date format in  DD-MM-YYYY (15-04-2021) if the date is in 15-04-2021 11:44:00 in this format.

DD-MM-YYYY (15-04-2021) if the date is in 04-15-2021 11:44:00 in this format.

Thanks

Khushboo

Labels (3)
1 Reply
Miguel_Angel_Baeyens

Use the Date#() and Date() functions to make sure what you display on Qlik or load using the script is always going to have a consistent timestamp.

E.g.:
LOAD *,
Date#(Date(Field, 'DD/MM/YYYY hh:mm'), 'DD-MM-YYYY hh:mm:ss') AS FormattedDate
FROM ...;
The first date mask is the "output" format you want it into, in this case, Spanish: DD/MM/YYYY and without seconds.
The second date mask is the "input" format from the field, in this case DD-MM-YYYY and with seconds.

More details here:
- Date and time interpretation: https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/date-ti...
- Date() function: https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/Formatt...
- Date#() function: https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/Interpr...