UiPath coping to excel in wrong format?

Hi all,

I have a date value .now.ToLocalTime.ToString(“dd/MM/yy HH:mm:ss”) and this works fine when I print this value to out .txt file for logging purposes.

When I write this to excel however I am using split to get just the date value:

split(now.ToLocalTime.ToString(“dd/MM/yy, HH:mm:ss”),", ")

I’ve tried adding:

split(now.ToLocalTime.ToString(“dd/MM/yy, HH:mm:ss”, System.Globalization.CultureInfo.InvariantCulture),", ")

UiPath is inputting the date as mm/dd/yy into excel which is the incorrect format.

Region on PC & Excel is set to Australia

Changing formatting in excel does nothing.

Example:

Date logged in .txt is 03/08/18 = Correct

Date logged in excel: 08/03/18 = Incorrect, changing format does nothing as this is the 8th of the 3rd is a valid date in March.

I am at a loss here. Any assistance is appreciated.

Hi @CBlanchard

The exact same thing happened to me yesterday and it took me way too long to figure out (including trying to fix in via VBA in Excel)

For me the solution was to not give the string that you want to save to the excel any custom date format when you initiate it.

So, the string you want to save should just be .Now.ToString and you save it to excel and only when you save you should give it your date format.

Let me know if that works for you :slight_smile: It was an issue exactly with the same date as yours :smiley:

1 Like

Champion!! It worked a treat.

This drove me nuts for days!!