Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sagar082
Creator
Creator

Convert date time field to timestamp

Hi folks,

Greeting for the day. I have a column which contains date and time in following format;

'24-AUG-21 12:00:00.4660000 AM'

It has string data type.

The desire format is;

24/08/2021 00:00:00

Should have data type timestamp.

12 Replies
PrashantSangle

Check timestamp() and Timestamp#()

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

=TimeStamp(Timestamp#('24-AUG-21 12:00:00.4660000 AM','DD-MMM-YY hh:mm:ss.ffff TT'))

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
akshatagrawal
Partner - Contributor III
Partner - Contributor III

use this

TimeStamp(Timestamp#(ColumnName,'DD-MMM-YY hh:mm:ss.ffff TT'),'DD/MM/YYYY hh:mm:ss') as ColumnName

Sagar082
Creator
Creator
Author

Hi,

Thank you for reply. But, it is not working.

PrashantSangle

what do you mean by not working?? is it giving you any error? or giving you wrong output? can you share some screenshot of it..

 

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Sagar082
Creator
Creator
Author

It is not giving error. It is not computing value, output is "-"

akshatagrawal
Partner - Contributor III
Partner - Contributor III

not sure, why it's not working for you. Please find below screenshot.

akshatagrawal_0-1632996169503.png

load * Inline
[
time1
24-AUG-21 12:00:00.4660000 AM
];

PrashantSangle

where you are writing?? in text box or in script??

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Sagar082
Creator
Creator
Author

Hi, Prashant

I'm writing in script, as keen to have column to make different operations.