Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Vlatko
Contributor
Contributor

How to change default datetime format for System.out.println in Talend?

Hi

Is there any way to change default datetime format for System.out.println in Talend?

In different scripts in my Talend jobs I write dates to the log file like this:

System.out.println("\n  context.ETL_Start_Time   = " + context.ETL_Start_Time);

The output is like this:

  context.ETL_Start_Time   = Fri May 06 16:30:00 CEST 2022

I would like it rather to be like this:

  context.ETL_Start_Time   = 2022-05-06 16:30:00

Of course, I can always use specific methods in order to format the dates as I wish, but that's not the point. I want to change the setup of Java / Talend installation so that I don't need to format dates every time I write them to the log file.

Best regards

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hello,

There are two types of routines in Talend Studio:

System routines: a number of system routines are provided. They are classified according to the type of data they process, such as: numerical, string, date. These types of routines are read-only, and you can call them directly in a Talend Job.

User routines: You can create your own new user routines or adapt existing routines.

From your use case, it is possible to create a user routine and call it in a Job.

Hope this online documentation helps

https://help.talend.com/r/en-US/8.0/standard/creating-user-routine-and-call-it-in-job

Best regards

Sabrina

 

 

View solution in original post

2 Replies
SMR040
Contributor III
Contributor III

Not sure how to modify the default date format in Talend...

 

But you could also create a Global Routine (or Bean if it's regarding routes) where you setup the date format as you want it and reuse that in your System.out.println line.

 

I hope this helps!

Anonymous
Not applicable

Hello,

There are two types of routines in Talend Studio:

System routines: a number of system routines are provided. They are classified according to the type of data they process, such as: numerical, string, date. These types of routines are read-only, and you can call them directly in a Talend Job.

User routines: You can create your own new user routines or adapt existing routines.

From your use case, it is possible to create a user routine and call it in a Job.

Hope this online documentation helps

https://help.talend.com/r/en-US/8.0/standard/creating-user-routine-and-call-it-in-job

Best regards

Sabrina