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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to change the date format?

hello to you all,

I have a column with mix date format (actually this column is character type)

how can i change the string to make them all in the same convention ?

lets say make them all mm-dd-yyyy hh:mm

09/27/2011 09:49

28-09-2011 15:25

09/27/2011 10:55

09/27/2011 11:22

09-11-2011 21:44

09/27/2011 11:19

09-11-2011 19:40

09-11-2011 16:42

09-11-2011 18:30

28-09-2011 13:10

Thanks

T.

2 Replies
Anonymous
Not applicable
Author

Use replace() function, and some formatting may be helpful.  This should work in most cases here:

timestamp(timestamp#(replace(yourfield,'/','-'), 'MM-DD-YYYY hh:mm'))

But you cannot guess if your 09-11 is Sep 11 or Nov 9 - you need some cleanup in the data source anyway.

Not applicable
Author

Use the following:

timestamp(timestamp#(KeepChar(Fieldname,'0123456789 :'),'MMDDYYYY hh:mm')).

Krian.