Need advices on how to convert into standard date format(MM/dd/yyyy) from June 6, 2021 and 24th May 2021, 02:30am PST and July 24th, 2021 02:00 PM PT

Please help me to convert the below dates to standard format MM/dd/yyyy if possible one line solution will be appreciated.

June 6, 2021
24th May 2021, 02:30am PST
July 24th, 2021 02:00 PM PT

@ks185332 - Please check this…

DateTime.ParseExact("June 6, 2021", {"MMMM d, yyyy","dd MMMM yyyy, hh:mmtt PST","MMMM dd, yyyy hh:mm tt PT"}, new CultureInfo("en-US"),DateTimeStyles.None).tostring("MM/dd/yyyy")

For the 2nd and 3rd dates, you have to replace th,rd,nd and st values before passing to the above code…

Hope this helps…

Hi @prasath17 ,Can you help me of the outlook mail body contains these different dates , then how do we extract them. like in below image is mail body and highlighted with black color boxes contains some text above and below. Now I need dates from the table given in below image and the table headers and columns are not standard. I am trying to get thru regex. but its not working for all different email body’s

DateTime.ParseExact("June 6, 2021", {"MMMM d, yyyy","dd MMMM yyyy, hh:mmtt PST","MMMM dd, yyyy hh:mm tt PT"}, new CultureInfo("en-US"),DateTimeStyles.None).tostring("MM/dd/yyyy")

Try with this

Sure…I can help with that.

Is it possible to send the mail body text…(mask the sensitive info) …??

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