data flow date format

arkiboys 9,596 Reputation points
2021-11-09T07:43:21.663+00:00

Hello,
I would like to format the column values in GB date format as follows but I get null.
Any suggestions?
note that the existing values (SourceFormat) are as in yyyy-MM-dd but I would like to change them to: dd/MM/yyyy

I use the following in the expression builder
toDate(toString(byName($0)),Config#lookup($0).SourceFormat, 'Europe/London')

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

Accepted answer
  1. HimanshuSinha-msft 19,376 Reputation points Microsoft Employee
    2021-11-11T00:11:26.977+00:00

    Hello @arkiboys ,
    Thanks for the ask and using Microsoft Q&A platform .

    I did try to play with the toDate function and though i was not successful , I know why its showing NULL in your case . Its expects a the input format as a parameter , which you are not passing . please read here

    Quick snippet from the doc

    toDate
    toDate(<string> : any, [<date format> : string]) => date

    Converts input date string to date using an optional input date format.

    --------

    I will try to get in touch internally with the SME’s , but now you can try the below work around .

    concat(split(SourceFormat,'-')3,'/',split(SourceFormat,'-')2,'/',split(SourceFormat,'-')1)

    148382-image.png

    Please do let me know how it goes .
    Thanks
    Himanshu

    -------------------------------------------------------------------------------------------------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    0 comments No comments

0 additional answers

Sort by: Most helpful