String to date conversion issues

I have a string as:- 14/Jan/20

Want to convert it into the date.
Please guide me on this. Thanks in advance…!

1 Like

Hi @Jayesh_678,

Take a Datetime Variable and use assign as shown below

image

Convert.ToDateTime(" 14/Jan/20")


Mukesh

1 Like

Syntax : DateTime.ParseExact(“ur date”,“ur date format”, nothing)

As perUr given date
DateTime.ParseExact(“14/Jan/20”,“dd/MMM/yyyy”, nothing)

There are many options to do
Like

DateTime.ParseExact(“14-Jan-20”,”dd-MMM-yy”,System.Globalization.CultureInfo.InvariantCulture)

Or

CDate(“14-Jan-20”)

Or

Convert.DateTime(“14-Jan-20”)

Cheers @Jayesh_678

2 Likes

Thanks for quick reply.

2 Likes

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