Format of date

Hello all,

I want to change format of date to dd/MM/yyyy but don’t want to convert into string variable.
Variable should be datetime.
I’m using this function CDate(datevariable.tostring(dd/MM/yyyy)) but it gives result as 01/01/2022 00:00:00 i dont want time…

HI @Ketan_Wajekar

How about this expression?

DateTime.ParseExact(datevariable,"dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")

Regards
Gokul

Hello @Ketan_Wajekar

You can use modify Date activity to achieve the same (1st video). If you want to go with the expression please watch the second video.

Thanks

Hi Ketan @Ketan_Wajekar ,

In order to change the format of your date and store it to a datetime variable please follow this expression:

DateTime.ParseExact(datevariable.toString(“dd/MM/yyyy”), “dd/MM/yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

In case of any confusion, please let me know.

BR,
Ahmad