Date conversion from yyyy-dd-MM hh:mm TO dd-MM-yyyy

Hi all,

I know a lot of topics already exists about date conversion, but I did not manage to find a working solution yet.
I am extracting a date in the following format via (web) data scraping:
image

I need the date in format 07/12/2018.

Can anyone help? Thanks!

Hi,

Use below code
DateTime.ParseExact("2018-07-12 11:52", "yyyy-MM-dd hh:mm",System.Globalization.CultureInfo.InvariantCulture).ToString("MM/dd/yyyy")

Regards,
Arivu

1 Like

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