Convert String to date in ADF

Raja 86 Reputation points
2022-07-06T05:17:00.537+00:00

Hello Team,
I am setting up a pipeline where I want to pull data from an external source using ADF pipeline.
I want to pull data of let's say yesterday nth day (today - n). So I have created a variable 'previousDay' using

@adddays(startOfDay(utcnow()),-n)  

The problem here is that, ADF doesnt allow to create Date variable/parameter ( so later I can use prevdate('dd') kind of function to access different fields of the Data variable).

Since the variable cannot be defined as 'Date' I am unable to use any date function. And if I define variable as String/Object, then there's no function to convert String to Date in the ADF UI.

could you please help here?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,196 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Suba Balaji 11,206 Reputation points
    2022-07-06T05:46:38.97+00:00

    Hi @Raja ,

    Thanks for posting your question on MS Q&A platform.

    Request you to kindly check this thread which discusses in similar lines (converting a string to date)

    Please revert in case you have further questions on it.

    thank you.