Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello guys,
I have a problem in my job here is it :
I would like to loop a datetime variable and display it with a tjava
here is my tflowtoiterate component :
but in my tjava component when i try to display my datetime variable it's ot working it's say object can not be convert into string
here my tjava component :
any help please to convert this variable into datetime or string
I suspect that you want something more like this.....
context.datetime=TalendDate.formatDate("yyyy-MM-dd HH:mm:ss.SSS",((Date)globalMap.get("last_datetime")));
System.out.println("Value Of Input:"+context.datetime);
This may need some tweaking as I was copying from your screenshot. It always helps to include code as text so that it can be copied and pasted when needing editing.
It looks like the value of "Last_datetime" is maybe not a String. Is it is a Date object? Also, it looks like the key should be "last_datetime" and not "Last_datetime". Can you identify the data type of the column that supplies that value?
yes here is my source :
my column is last_datetime it's a datetime type and in my tmssqlinput here is the schema :
thx you for your answer.
I suspect that you want something more like this.....
context.datetime=TalendDate.formatDate("yyyy-MM-dd HH:mm:ss.SSS",((Date)globalMap.get("last_datetime")));
System.out.println("Value Of Input:"+context.datetime);
This may need some tweaking as I was copying from your screenshot. It always helps to include code as text so that it can be copied and pasted when needing editing.