How to change the excel date format from DD/MM/YYYY to YYYY-MM-DD

Hi I want to change the date format from a column, I tried format cells from excel activities, but it doesn’t have the format I want.

How can I do this?

@adrianab.98

While writing to excel you can include a single quote before the value and it would come as the exact same format

’2023-04-03

Try adding the value like this

Cdate(dateasstring).ToString("yyyy-MM-dd")

Cheers

Hi @adrianab.98

You can use the following function in the assign activity:

UpdatedDate = DateTime.ParseExact(dateVar.ToString,“dd/MM/yyyy”, Globalization.CultureInfo.InvariantCulture).ToString(“yyyy-MM-dd”))

Here, dateVar is the variable in which your date of format dd/MM/yyyy is store.
You can use the same thing for all variations of dd MM yyyy.

Hope this helps,
Best Regards.

Hello @adrianab.98

I used the Format cells activity, configured a custom category, and entered the desired date and time format (yyyy-MM-dd). It sort of worked for me; the left screenshot below shows the data before I ran the automation, and the right excel shows the results. I hope this helps.

Happy Automation :slight_smile:
Thanks.

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