Rename activity got wrong result

When I was following official training course, in loops: While, Do while and For each section, with this Assign activity to rename file name, expression is:
Name.Replace(“.txt”, Now.ToString(“_yyyy_MM_dd”+“.txt”))
but the result I got is:

It is strange, because yesterday’s result is like: 1_2025_10_28.PxP.
Could anyone help to look into this issue, thanks.

Hi,

Can you try the following expression because t means AM or PM in DateTime.ToString method.

Name.Replace(".txt", Now.ToString("_yyyy_MM_dd")+".txt")

Regards,

Thank you Yoichi!
Problem solved, that’s exactly the root course, the position of Closing parenthesis.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.