Unable to format string value in DateTime format using Format Value activity

activities

#1

Hi,

I am trying to format a Generic value which is in Date format i.e. “31/12/2017” using Format Value activity but UiPath throws an error stating Cannot Convert Generic Value to Syste.DateTime

Please assist if I need to format a generic value to datetime format of “MM/dd/yyyy”

Regards,
Ashish


#2

Hi @Ashish32229,

Generic value -> genValue (31/12/2017)
DateTime.ParseExact(genValue.ToString(),"dd/MM/yyyy",Globalization.CultureInfo.InvariantCulture).ToString("MM/dd/yyyy")

Regards,
Arivu :slight_smile:


Converting date
#3

Hey Arivu,

Thanks for response but I need to format using Format Value activity… Is that possible?

Above way is already used by me but was checking for Format value activity.


Format Values Giving Wrong output
#4

It will not support in Format to Date time value, so use the below one.

Regards,
Arivu :slight_smile: