Dates in a Talend job

Mission: A friend sent me an email today. His question:

I have 2 incoming flows

Datebeg: DD/MM/YYYY format
Hourbeg: in minutes (example: 540 = 9h00)

How do I do to get this output: YYYYMMDDHHMMSS?

My answer:

I would do that:

First, add the minutes (Hourbeg) to the date (Datebeg):
TalendDate.addDate(row1.Datebeg, row1.Hourbeg, “mm”) 
The Datebeg type is Date.
The Hourbeg type is Integer.

Then, format the date :
TalendDate.formatDate(“yyyyMMddHHmmss”,Var.date2) 
Var.date2 is the output of TalendDate.addDate. Its type is Date. The output is gonna be a String.

Questions in French, Portuguese, Italian, Spanish, Romanian are welcomed.

Advertisements
Dates in a Talend job

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s