I am new to Talend I want to find the difference between the two timestamps.
I am having two columns start_time
and end_time
.
I want to make a table in destination that will show the difference in both the timestamps, specifically I want to show hours mins and seconds.
Also I want time in timestamp not in ling format, how can I achieve this
start_time- 2021-06-18 08:27:52.000000
end_time- 2021-06-18 08:29:59.000000
I tried-
creating a variable 'ms' of long type in tmap = TalendDate.diffDate(row181.start_time,row181.end_time,"mm")
for converting into hh:mm:ss
String.format("%02d:%02d:%02d.%d", (Var.ms / (1000 * 60 * 60)) % 24, (Var.ms / (1000 * 60)) % 60, (Var.ms / 1000) % 60, Var.ms % 1000)
if I make table as string I am getting this err-
column "call_duration" is of type bigint but expression is of type character varying
Above T-map expression returning zero also I have to use long in the destination column type, but I want date type
Example : with row1.diffDate being your diffdate in seconds in input of a tMap, you could separate in three different columns. Then you'll only have to concatenate all values in a string. if you want a string output with ":" separator.