Irregularities within project when modifying the same string in different sequences

Hi,

So I have a project where I utilise a dictionary of strings. One of the strings in the dictionary is a “MM/dd/yyyy HH:mm:ss” which I succesfully convert into a datetime variable and then back to string in d/M/yy format.

My problem is that in other sequence this works but in another it does not. Even though the actions are the same… is this some sort of a bug. How can I solve it?

Thanks in advance.

Hi @mikko_lil, welcome to the Community.

If the issue persists, you can implement the following function for each datetime in the dictionary:

Datetime.ParseExact(variable.ToString(), “MM/dd/yyyy HH:mm:ss”).ToString(“d/M/yy”)

Hope this helps,
Best Regards.

@mikko_lil

Welcome to the community…

Can you elaborate on the issue…are you getting any error or a wrong output?

Before performing did you try printing the variable to check if the value is proper

Cheers

Thanks for the quick responses!

It turns out my initial diagnosis was incorrect. Problem solved. Making proper logs while testing would have helped me here. :smiley:

1 Like

@mikko_lil

Happy Automation

Cheers

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