Parsing a date string written in long format

Hi All,

I am trying to parse dates written in long-word format, i.e. “Tuesday 3rd December 2019” to a DateTime

Has anyone dealt with this? Any suggestions appreciated!

@James_Smith Try like below.

Str=  “Tuesday 3rd December 2019”

DateTime.ParseExact(str.Replace("st","").Replace("rd","").Replace("th",""),"dddd d MMMM yyyy",Nothing).ToString("dd/MM/yyyy")
4 Likes

dateTime.xaml (6.5 KB)

Please refer this @James_Smith

Thanks!

1 Like

Thank you both - that’s got it sorted!

1 Like

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