Date Conversion in Visual Basic

How to convert

18-Apr-2022 → 18/04/2022

18-Jun-2022 → 18/06/2022

18-Sep-2022 → 18/09/2022

And SO on.

Hi,

Can you try the following?

DateTime.ParseExact(yourDateString,"dd-MMM-yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")

Regards,

grafik
CDate(yourDateStringVar).tostring("dd/MM/yyyy")

Vice Versa ?

with the datetime.Parseexact method mentioned by @Yoichi and the adopted date format

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