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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
DrGenious
Creator
Creator

Timestamps Convert

Hello,

I have a string "20200000000000" and I want to convert this to a Date (timestamp). Can you please help me? 

Labels (2)
1 Solution

Accepted Solutions
DrGenious
Creator
Creator
Author

I found the solution. 

I converted the "2.02E+19" to BigDecimal. After I converted it toPlainString() and the I parsed this Plain String to .parseDate. 

View solution in original post

5 Replies
karthikj18
Contributor III
Contributor III

Looking at the string  "20200000000000", the most suitable time format would be "yyyyMMddHHmmss".

Use TalendDate.parseDate("yyyyMMddHHmmss", "20200000000000") in a column with output as date data type.

DrGenious
Creator
Creator
Author

Thanks a lot but I have one more question . If we have a column with different string dates for example "202000000" on the first row, "2301023010" on the second .

DrGenious
Creator
Creator
Author

0683p000009M8q7.png @karthikj18  It shows me error.

 

Basically this happens because the values are strings but they are "2.02.E+13" .How to convert them?

karthikj18
Contributor III
Contributor III

Looks like you are reading excel data. "2.02.E+13" usually a formatted date format in Excel. Check if this is the scenario, correct it in source component itself by giving proper date format in schema. Also catch the rejected records based on schema data type.

DrGenious
Creator
Creator
Author

I found the solution. 

I converted the "2.02E+19" to BigDecimal. After I converted it toPlainString() and the I parsed this Plain String to .parseDate.