Convert Date in Modify Stage

How to convert date format from dd/mm/yyyy to yyyy/mm/dd in modify stage?

Questions by balaya4u

Showing Answers 1 - 3 of 3 Answers

To convert date from DD/MM/YYYY to YYYY/MM/DD, first we have to change the default date format in the job. Follow below steps:


1. Go to job property. Go to Defaults tab. There un-check the option for date string default. Put %yyyy/%mm/%dd in place of the default one.
2. Now, Use modify stage to change the date format. use below derivation and put it into the specification:
<OutPut column Name>:date=date_from_string["%dd/%mm/%yyyy"](<Input Column name>)

For example, input column in_date is having a string which needs to be converted to date and the output column is out_date which will have date data type, Below will be used:

out_date:date=date_from_string["%dd/%mm/%yyyy"](in_date)

Hope this helps.

Regards
Braj.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions