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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

convert date into ISO format

Hi Team,

 

I have a date in format "Timestamp -> 2019-47-0610:47:28".

 

I have to convert this date into "ISODate("2019-01-03T09:09:20.002Z")" this format the above timestamp is in long date type.

 

How can we do this in talend?

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Ah, your format is wrong. This...

output_row.data_high_timestamp = java.time.format.DateTimeFormatter.ofPattern("yyyy-mm-ddHH:mm:ss").format(java.time.Instant.ofEpochMilli(time_datastart).atZone(java.time.ZoneOffset.UTC));

...should be this.....

output_row.data_high_timestamp = java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-ddHH:mm:ss").format(java.time.Instant.ofEpochMilli(time_datastart).atZone(java.time.ZoneOffset.UTC));

You have given the minutes as months. There are not 47 months in a year 🙂

 

 

 

View solution in original post

3 Replies
Anonymous
Not applicable
Author

What date does 2019-47-0610:47:28 represent?

Anonymous
Not applicable
Author

Hi,

 

It's time in date format:-

output_row.data_high_timestamp = java.time.format.DateTimeFormatter.ofPattern("yyyy-mm-ddHH:mm:ss").format(java.time.Instant.ofEpochMilli(time_datastart).atZone(java.time.ZoneOffset.UTC));

 

time_datastart ->

time_datastart = ((Double)(jsonArray.getJSONArray(0).get(0))*1000);

 

and in datetype I am using Date format "yyyy-MM-dd hh:mm:ss".

Anonymous
Not applicable
Author

Ah, your format is wrong. This...

output_row.data_high_timestamp = java.time.format.DateTimeFormatter.ofPattern("yyyy-mm-ddHH:mm:ss").format(java.time.Instant.ofEpochMilli(time_datastart).atZone(java.time.ZoneOffset.UTC));

...should be this.....

output_row.data_high_timestamp = java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-ddHH:mm:ss").format(java.time.Instant.ofEpochMilli(time_datastart).atZone(java.time.ZoneOffset.UTC));

You have given the minutes as months. There are not 47 months in a year 🙂