Hi,
I want to change a date format from September 27, 2019 to 09/27/2019. Can someone help me with the easiest way to achieve this using assign activity.
Thanks,
Sudesna
Hi,
I want to change a date format from September 27, 2019 to 09/27/2019. Can someone help me with the easiest way to achieve this using assign activity.
Thanks,
Sudesna
Sure, you can use DateTime parser
StringDate= DateTime.ParseExtract(yourString, “MMMM dd, yyyy”, System.Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”)
Some variation of that can work
I have tried this. I also do not want to parse it to String. have all variables in Date/Time format
You can change it to a String then back again to DateTime using the same ParseExtract, just now you will use
YourDateTimeFormat = DateTime.ParseExtract(YourNewString, “dd/MM/yyyy”, System.Globalization.CultureInfo.InvariantCulture)
Hi @sudesna_mishra,
You can also try something like this
DateTime_Var= cdate(YourDate.ToString("dd/MM/yyyy"))
Regards,
Nimin
hi
you can use this:
convert.ToDateTime(yourstring.Trim).toString(“dd/MM/yyyy”)
where yourstring is September 27, 2019 in your case
the above can be placed directly in an assign activity to a string variable
also for your case you should interchange the MM with dd
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.