Date format : Remove the "/" in a date

Hi everyone,

I have date format that is yyyy/mm/dd and I would like to use Uipath to change it to the following format : ddmmyyyy
I successfully converted my date from yyyy/mmm/dd to ddd/mm/yyyy but now I am strugling to remove the “/”.
Need help :slight_smile:
Thanks!

Is this being stored as a string or a datetime variable? If it is a string then you could do the following in an assign activity

yourdatestring=yourdatestring.Replace("/", "")

It is a string, thanks!

1 Like

I disagree that you should use .Replace() in this situation. If you show how you converted the format, then there is probably just a small adjustment we can make to that to remove the slash. So, if you can show how you converted it, I can advise further.

Regards.

I think that the best solution in order to avoid creating two lines of code would be to do the following:
Input = “2018/05/11”
Output = CDate(Input.ToString).ToString(“ddmmyyyy”).

It worked for me…

Right. That’s similar to what I would have suggested. It’s best to format dates as datetime types as you did there, rather than replacing characters.

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