String to Date in VB.Net?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

This seems simple but I don't know what I am doing wrong.

I have a string as "15122004"

I want to convert this to a date.

I have Option Strict On.

How can I convert this string to a date in format ("dd/mm/yyyy") without
turning off Option Strict?

Thanks.
 
Hi,

Try DateTime.ParseExact().

Eg: DateTime.ParseExact ("15122004", "ddMMyyyy", Nothing)

Hi,

This seems simple but I don't know what I am doing wrong.

I have a string as "15122004"

I want to convert this to a date.

I have Option Strict On.

How can I convert this string to a date in format ("dd/mm/yyyy") without
turning off Option Strict?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top