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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date format

Hello!

I've got a datefield formatted like 2009/09/01:12:00:29 AM (YYYY/MM/DD:HH:MM:SS TT). I want this to be dateformatted like 01-09-2009 12:00:29.

Can you help me?

Regards, Sander

1 Solution

Accepted Solutions
Not applicable
Author

Hi Sander,

if it is a text field than write:

TimeStamp(TimeStamp#(Date, 'YYYY/MM/DD hh:mm:ss tt'), 'DD-MM-YYYY hh:mm:ss)

TimeStamp# is for interpretation and TimeStamp to format your data.

If it doesn´t work please provide some data as example.

Good luck!

Rainer

View solution in original post

6 Replies
Not applicable
Author

Sander,

your code are:

TimeStamp(Date, 'DD-MM-YYYY hh:mm:ss') as NewTimeFormat

Please see also QV help and time functions like Timestamp, Day, Year and so on ...

Good luck!

Rainer

Not applicable
Author

=TimeStamp(date,'DD-MM-YYY HH:MM:SS') ?

--Arun

Not applicable
Author

Hi Guys,

I have tried the TIMESTAMP function. But because the dateformat of the original field isn't interpreted as a datefield this function can't reformat it to the desired format. The original field is YYYY/MM/DD:HH:MM:SS TT, how do I tell QlikView this is a datefield? I am loading from a flat .csv file so I think QlikView interpretes this as a text string or something..

Hope to hear from you..

Regards, Sander

Not applicable
Author

Hi Sander,

if it is a text field than write:

TimeStamp(TimeStamp#(Date, 'YYYY/MM/DD hh:mm:ss tt'), 'DD-MM-YYYY hh:mm:ss)

TimeStamp# is for interpretation and TimeStamp to format your data.

If it doesn´t work please provide some data as example.

Good luck!

Rainer

biester
Specialist
Specialist

Try

date(date#(datefield,'YYYY/MM/DD:hh:mm:ss tt'),'DD-MM-YYYY hh:mm:ss')

Rgds,
Joachim

Not applicable
Author

Hi Guys,

Both Rainers as Joachim's expressions did the trick. The Timestamp# or Date# functions did the trick, I didn't knew the exact function of adding the #.. That's clear now. I have marked Rainers expression as the solution because the TIMESTAMP function seems to perform better than the DATE function.

Thanks for your time!

Regards, Sander