Good day everyone,
I am trying to change the date format from yyyy/mm/dd to yyyy-mm-dd from this:
TO:
In my flow I am using this to format the ReceiptDate which is yyyy/mm/dd on the first screenshot :
It is suppose to take the exact date as this and just change the slash ‘/’ to ‘-’:
But the results are totally different check below:
Can someone assist please
mkankatala
(Mahesh Kankatala)
February 4, 2025, 10:53am
2
Hi @Anelisa_Bolosha1
Just change the below expression to,
DateTime.parseexact(ReceiptDate.toString, "yyyy/MM/dd", System.globalization.Cultureinfo.InvariantCulture).toString("yyyy-MM-dd")
m should be capital for months.
Hope it helps!!
It worked, thanks so much @mkankatala .
Very helpful.
Cheers
1 Like
Quick and dirty:
since you convert from string → string, and the only ‘date’ component is your own interpretation of the data, you might as well have done this:
Assign RecipientDate2 = RecipientDate.Replace(“/”, “-”)
If RecipientDate is in a DateTime format to start with (since you felt the need to add .toString) you could have done the direct transformation by this:
Assign RecipientDate2 = RecipientDate.ToString(“yyyy-MM-dd”)
Note that mm indicates minutes, and MM months.
1 Like
system
(system)
Closed
February 7, 2025, 11:03am
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.