I have an ADFv2 pipeline in which I’m trying to take a string (or a date) and output it in this format: ‘2024-07-12T09:29:20.790-07:00’ which I thought would be @formatDateTime(utcnow(), 'yyyy-MM-ddTHH:mm:ss.fffK')
this doesn’t work however and I end up with “2024-07-12T16:29:20.79Z” Well Workday wants the string in the format of 2024-07-12T09:29:20.790-07:00. Also format of ‘yyyy-MM-ddTHH:mm:ss.fffkkk’ does not work either.
I’ve tried converting my date to a string and concat the -07:00 that worked until I replace the “2024-07-12 09:29:20.790-07:00” The space with a T and then I ended up with ‘2024-07-12T16:29:20.79Z’. As soon as the string had a T in it ADF converted it to a timestamp even though I wanted it to be a string.
Here is the current conversion attempts this first one with formatDateTime:
substring(activity('Create Edition').output.firstRow.StartCreatedMoment, 0, length(activity('Create Edition').output.firstRow.StartCreatedMoment)),
if(
and(
greaterOrEquals(substring(activity('Create Edition').output.firstRow.StartCreatedMoment, 0, 10), concat(formatDateTime(utcNow(), 'yyyy'),'-03-10')),
lessOrEquals(substring(activity('Create Edition').output.firstRow.StartCreatedMoment, 0, 10), concat(formatDateTime(utcNow(), 'yyyy'),'-11-03'))
),
'-07:00',
'-08:00'
)
), ' ', 'T'), 'yyyy-MM-ddTHH:mm:ss.fffzzz')```
And this one just has the replace:
```@replace(concat(
substring(activity('Create Edition').output.firstRow.StartCreatedMoment, 0, length(activity('Create Edition').output.firstRow.StartCreatedMoment)),
if(
and(
greaterOrEquals(substring(activity('Create Edition').output.firstRow.StartCreatedMoment, 0, 10), concat(formatDateTime(utcNow(), 'yyyy'),'-03-10')),
lessOrEquals(substring(activity('Create Edition').output.firstRow.StartCreatedMoment, 0, 10), concat(formatDateTime(utcNow(), 'yyyy'),'-11-03'))
),
'-07:00',
'-08:00'
)
), ' ', 'T')```
If you remove the replace the string is exactly how I want it, but I need to replace the ' ' (space) with a 'T'
How do I get ADF to format my date timestamp the way I want it to be?