How to create a folder name with today's date and make it to take any system's format?

I want the system to take any global format it finds on the machine and use it as a folder name. I need to change DateTIme.TOday.ToString(“dd-mm-yyyy”) to be of any format that the robot finds on the machine

Hi @samuel.chaane, please try

Path.Combine(PathToProjectFolder,  
Date.Now.ToString(System.Globalization.CultureInfo.CurrentCulture).Split(" "c)(0))

Its giving me two digits and I want it to be dd-mm-yyyy format, either 01-December-2018 or 01-12-2018 or 01-Dec-2018

Fixed. I used this one, though it only takes the format on my machine. I needed to use a global one,
Path.Combine(PathToProjectFolder, DateTime.Today.ToString(“dd-MMMM-yyyy”)
)

Thank you very much

I used this one Path.Combine(PathToProjectFolder, DateTime.Today.ToString(“dd-MMMM-yyyy”)
)

My problem is that it only takes the format on my machine, I wanted it to be global

I am wrong. Actually I wanted this specific format

The output I am getting is this 10DDYYYY instead of 10062020

Use MMddyyyy, MM stands for the two digit month and the date and year has to be small letters for it to work. If you would like to have Oct062020, then you can use MMMddyyyy. If you want full month name like October062020 then use MMMMddyyyy.

1 Like

Thank you very much. It worked

1 Like

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