Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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 🙂
What date does 2019-47-0610:47:28 represent?
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".
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 🙂