Convert Date "dd Mon yyyy"

How can I resolve this issue?

Kindly share your sample excel file
@Stabbathehut

Thats written from the datatable as well

Untitled.zip (780 Bytes)

If you have control over your excel, format that column as Date, before reading it. If not, than use a message box with text like this DirecCast(row(0), String)

Another expression is needed for this to work.

JobBoard.zip (14.8 KB)

Here is the Project File

you should remove that
row("Date Published")=Datetime.ParseExact(row("Date Published").ToString,"dd MMM yyyy",system.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")
and since data comes from a data scrape from the web, the string format should be the same as you see in the web page.

Still getting string not recognised as valid DateTime

Hello @Stabbathehut,

Might be late but can you try checking the Preserved Format when reading the Excel file then use below code:

DateTime.ParseExact(row(“Date Published”).ToString, “d-MMM-yy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

I have a different situation
Some time date is like Jan 2 2021 → there is a problem, string is not getting recognized due to 2 spaces after Jan
Jan 20 2021 → no problem here, string is getting recognized

Help to resolve this and create a date format to recognize the string in excel

image

Please help.
Thank You.

Hi,

Can this conversion be done in one go? If we have to do row by row, its taking a very long time. I have multiple sheets to do this date conversion, from “dd-MMM-yyyy” to “MM/dd/yyyy”