Forum Discussion
Dynamic Value Date formatting
- 2 years ago
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
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.
When I look at the Input criteria after running the Pipeline, here's what's now showing for that value;
If I hardcode a datetime in there it also converts it to Zulu;
If I wrap that hardcoded datetime to change it to a literal string then it works fine.
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...
- Anonymous2 years agoNot applicable
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.
- Anonymous2 years agoNot applicable
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.