Get current date in the format: March 10th, April 2nd

Hey, I need to Get the current date in the format: March 10th, April 2nd… Is there an easy expression for that?

If MyDateTime is your DataTime datatype variable:

MyDateTime.ToString("MMMM d") + if(MyDateTime.Day.ToString(d).Length = "1", "st", if(MyDateTime.Day.ToString.Substring(MyDateTime.Day.ToString(d).Length - 1, 1) = "2", "nd", if(MyDateTime.Day.ToString.Substring(MyDateTime.Day.ToString(d).Length - 1, 1) = "3", "rd", "th")))

English ordinal indicators are awful. If this were French, it would just be
MyDateTime.ToString("MMMM d") + "e"

Hi,

Check the workflow

Date with nd_th_rd.xaml (5.6 KB)

Hope this works

Thanks

@jadbenn
Check This
https://connect.uipath.com/marketplace/components/format-date-with-sufix
FormatDateWithSufix.xaml (12.4 KB)

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