Convert Julian date yyjjj to yyyyMMdd in Azure data factory

Kumar Apparaju 21 Reputation points
2021-02-26T07:41:21.91+00:00

I have incoming date yyjjj need to convert to yyyy-MM-dd in Azure data factory

for 10010 is 2010 January 10th , this need to converted to 2010-01-10 . Please help

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

Accepted answer
  1. Vaibhav Chaudhari 38,671 Reputation points
    2021-02-26T08:44:58.547+00:00

    Try using below like expression. Couldn't figure out any other way rather than hardcoding

    I am first creating a date 2010-01-01 and then adding (10-1) days to it

    @formatDateTime(addDays(concat('20',substring(variables('JD'),0,2),'-01-','01'),add(int(substring(variables('JD'),2,3)),-1)),'yyyy-MM-dd')
    

    Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav


0 additional answers

Sort by: Most helpful