You have to remove trailing zeros (example 3 zeros exists in your input (assuming that this timestamp is in milliseconds), you can write a simple code for this in flow/java) and pass it to the previous code and see what is the output you get?
You can also try this code below that outputs in local date time: Check all the possible input values and code it accordingly.
IDataCursor pipelineCursor = pipeline.getCursor();
String myTimeAsLong = (String) IDataUtil.get( pipelineCursor, "myTimeAsLong" );
//long unix_seconds = 1563370941;
long unix_seconds = Long.parseLong(myTimeAsLong);
//convert seconds to milliseconds
Date date = new Date(unix_seconds*1000L);
// format of the date
SimpleDateFormat jdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String java_date = jdf.format(date);
System.out.println("\n"+java_date+"\n");
IDataUtil.put( pipelineCursor, "dateTimeStamp", java_date );
pipelineCursor.destroy();
Make sure to import the below classes:
import java.util.Locale;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Date;
Let me know if you have any questions, meanwhile I will post an article/blog on the same.
#Flow-and-Java-services#Integration-Server-and-ESB#webMethods