Conversion of string to date in ADF dataflow using derived column is not working as expected.

Burra, Karthik 25 Reputation points
2023-06-30T14:10:50.6566667+00:00

Hi Microsoft team,

I am trying to convert string value to date in the format of yyyymmdd. But the value is not converting as expected.

Eg:

20230424 as string is converted to 2023-01-24 as a date.

Here April is converted to January month.

Expression:

toDate(LAEDA,'yyyymmdd')
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
{count} votes

Accepted answer
  1. AnnuKumari-MSFT 34,551 Reputation points Microsoft Employee Moderator
    2023-07-07T08:37:03.3566667+00:00

    Hi Burra, Karthik ,

    That's right. toDate function expects the input string format as the second parameter . For Month, we need to provide 'MM' . If your input string is '12/18/2012' , your expression should be toDate('12/18/2012', 'MM/dd/yyyy')

    The output will always be in yyyy-MM-ddformat.

    Kindly accept the answer by clicking on Accept answer button. Thankyou

    2 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Burra, Karthik 25 Reputation points
    2023-07-06T18:12:54.7433333+00:00

    @After replacing from "mm" to "MM" it worked.

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.