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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[tJavaRow] Retrieve the current date

Hello everybody,
I would like retrieve the current date when I run my job, I have in my datawarehouse a special field (date format) for that. I tried with tJavaRow like that :
----------------------------------
import java.util.date;
output_row.UPD_DATE = new Date ("yyyy/MM/dd");
----------------------------------
In the code part my import java.util.date cannot be resolved to a type
and for the other line i have "the constructor date(string) is deprecated

So i would like to know if I can retrieve the current date like that or if i should use an other method etc...
Thanks for all help.

PS : I'm not Accustomed to speak english so if If there are english errors i'm very sorry
Labels (3)
3 Replies
erwan2
Contributor
Contributor

Hi,
you can use (without "import java.util.date;") :
output_row.UPD_DATE = TalendDate.parseDate("yyyy/MM/dd",TalendDate.getDate("CCYY/MM/DD"));
--
R
Anonymous
Not applicable
Author

thank you very mutch, it's perfect
Anonymous
Not applicable
Author

can we, when we run the job, make a distinction between insert date and update date?