You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
Hi
I am trying to set a string context variable to the current date
context.setProperty("run_date", TalendDate.getDate("YYYY-mm-dd"));
System.out.println( context.run_date);
but I get nothing returned?
Help?
Offline
Hi,
Nope.
I am trying to set it in a tJava component at the start of the job. I have read other post and it says to use the setproperty function I just can't get it to work.
Thanks in advance for help.
Offline

Hi,
Yep.
I have multiple jobs right now that I set the current date in the tJava component at the beginning of the flow so that I can use it in later parts of the job.
Have you tried the method I suggested? Because like I said, it works for me.
Infact, I think if you want to format the date it has to be this way:
context.run_date = TalendDate.formatDate("yyyy-MM-dd",TalendDate.getCurrentDate());
Last edited by jkrfs (2010-02-05 22:28:42)
Offline
Pages: 1