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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
khan_imran
Creator II
Creator II

Date field format correction

Hello All,

I am getting below information in Date which from system. Now, I want to convert it into MM/DD/YYY hh:mm:ss format.

Fri Jan  1 00:00:56 2016.262 (Day,Month, Date, hh:mm:ss, Year, ms)

Kindly assist me on this.

Regards,

Imran Khan

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Maybe like this

=Timestamp(Timestamp#(Subfield(Mid('Fri Jan  1 00:00:56 2016.262',5),'.',1),'MMM  D hh:mm:ss YYYY'),'MM/DD/YYYY hh:mm:ss')

[there are different approaches possible to interpret your input value, but basically, use interpretation timestamp#() function on the relevant part of your input value and format using timestamp()

For example, if you want to keep the milliseconds in the numeric representation:

=Timestamp(Timestamp#(Mid('Fri Jan  1 00:00:56 2016.262',5),'MMM  D hh:mm:ss YYYY.fff'),'MM/DD/YYYY hh:mm:ss')

]

Get the Dates Right

Why don’t my dates work?

View solution in original post

2 Replies
swuehl
Champion III
Champion III

Maybe like this

=Timestamp(Timestamp#(Subfield(Mid('Fri Jan  1 00:00:56 2016.262',5),'.',1),'MMM  D hh:mm:ss YYYY'),'MM/DD/YYYY hh:mm:ss')

[there are different approaches possible to interpret your input value, but basically, use interpretation timestamp#() function on the relevant part of your input value and format using timestamp()

For example, if you want to keep the milliseconds in the numeric representation:

=Timestamp(Timestamp#(Mid('Fri Jan  1 00:00:56 2016.262',5),'MMM  D hh:mm:ss YYYY.fff'),'MM/DD/YYYY hh:mm:ss')

]

Get the Dates Right

Why don’t my dates work?

khan_imran
Creator II
Creator II
Author

Thanks Stefan.. It worked.