Five Stars

Extract Month from Date converting String to Date

I have a requirement to extract Date which is coming as String in table. I have to convert it to Date in MM/DD/YYYY format and have to extract Month from it. Can anyone suggest what to Do
5 REPLIES
Five Stars

Re: Extract Month from Date converting String to Date

Hi Shong/TRF/xdshi,

 

Can you please help


abhi90 wrote:
I have a requirement to extract Date which is coming as String in table. I have to convert it to Date in MM/DD/YYYY format and have to extract Month from it. Can anyone suggest what to Do

 

Moderator

Re: Extract Month from Date converting String to Date

Hello,

You can use convert type in tMap or tConvertType component.

Could you please elaborate your case with an example with input and expected output values? In this way, we can design a demo job for you and post the setting screenshots in this topic.

 

Thanks for your time.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: Extract Month from Date converting String to Date

Hi xdshi,

 

Thanks for your reply. I have data like this 01/07/2017 which is string in Source. Now I want to convert it into Date with MM/DD/YYYY format and want to extract only Month. So Output should I get is 01. 

Seven Stars

Re: Extract Month from Date converting String to Date

Talend1.PNG

 

Try the above function.

Regards,

 

Veeranjaneyulu Boppudi
Moderator

Re: Extract Month from Date converting String to Date

Hello,

If you want to convert String to Date data type. You can use built-in function TalendDate.parse

Please have a look at my screenshots for details.

In addition that yyyy stands for Year,  dd stands for day in month(01~31) and DDD stands for Day in year(001~336) in Java.

1.1.png2.png3.png4.png

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.