Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Fabrico
Frequent Visitor

Dynamic Value Date formatting

I've got an API call that I'm trying make that requires a date format like;

 

yyyy-MM-ddThh:mm:ss+00:00

 

For some reason, even though I can get Data Factory to create this as a format, as soon as I try to use it as a dynamic value in a Rest Copy Data additional header the system decides to reformat it as;

 

yyyy-MM-ddThh:mm:ssZ

 

And it's no longer accepted by the API I'm calling.

 

Is there some way to force Data Factory to stop doing this conversion?  I've tried using CONCAT, sticking the value into a String Variable, nothing seems to work.

1 ACCEPTED SOLUTION
HimanshuS-msft
Community Support
Community Support

Hello  
Let me start with it was a hard nut to crack  🙂 , took me few hours . This is what worked for me . 

@formatDateTime(utcnow(),'yyyy-MM-ddTHH:mm:ss zzz')

 

Output
 
{ "name": "Change Date format", "value": "2024-01-31T22:26:37 +00:00" }

 

Hope this helps . 

Thanks 
Himanshu 

 

 

@Fabrico

View solution in original post

7 REPLIES 7
HimanshuS-msft
Community Support
Community Support

Hello  
Let me start with it was a hard nut to crack  🙂 , took me few hours . This is what worked for me . 

@formatDateTime(utcnow(),'yyyy-MM-ddTHH:mm:ss zzz')

 

Output
 
{ "name": "Change Date format", "value": "2024-01-31T22:26:37 +00:00" }

 

Hope this helps . 

Thanks 
Himanshu 

 

 

@Fabrico

This solved the problem, thanks for your efforts!

Hello @Fabrico ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
In case if you have any resolution please do share that same with the community as it can be helpful to others .
If you have any question relating to the current thread, please do let us know and we will try out best to help you.
In case if you have any other question on a different issue, we request you to open a new thread .

v-gchenna-msft
Community Support
Community Support

Hi @Fabrico ,

Thanks for using Fabric Community

Can you please try to use the utcNow() function with custom formatting in Fabric Data Factory:

Instead of relying on the pre-formatted date time, you can use the utcNow() function within your expression to generate the current date and time in UTC. Then, use string manipulation functions like substring and concat to format it according to your requirement:

 

@utcNow('yyyy-MM-ddThh:mm:ss') + '+00:00'

 

 
Hope this is helpful. Please let me know incase of further queries.

Thanks for your reply, I've tried formatting the date in a number of different ways but Fabric/Data Factory seems to be automatically converting it into a Zulu time before passing it to the API.

 

Fabrico_0-1706133353906.png

 

When I look at the Input criteria after running the Pipeline, here's what's now showing for that value;

 

Fabrico_1-1706133422564.png

 

If I hardcode a datetime in there it also converts it to Zulu;

 

Fabrico_2-1706133590064.png

Fabrico_3-1706133609356.png

 

If I wrap that hardcoded datetime to change it to a literal string then it works fine.

Fabrico_5-1706133763210.png

 

Fabrico_4-1706133746295.png

 

I've also previously tried wrapping the Dynamic value with literal strings but it always seems to convert the datetime before understanding it's a literal.

 

I'm struggling to understand why we're given the ability to format the date in the Dynamic Value box if Data Factory is just going to change it to whatever it wants anyway...

Hi @Fabrico ,

Apologies for the issue you have been facing.  If its a bug, we will definitely would like to know and properly address it.

Please go ahead and raise a support ticket to reach our support team: support-ticket-link

 

After creating a Support ticket please provide the ticket number as it would help us to track for more information.

Thank you.

Hi @Fabrico ,

We haven’t heard from you on the last response if you got a chance to create support ticket, please provide the ticket number as it would help us to track for more information.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayFBCUpdateCarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.