Convert date string into date object

T

Tony B

I'm looking to convert a string in "dd/MM/yy" format into a date object. How
do I go about this ?
 
C

Cor Ligthert[MVP]

Tony,

As you are in the part of the world where an European language is spoken not
Russian or Swedish and not in the USA, then you can simple try the very
simple optimized .Net command

\\\
dim myDate = CDate(31/12/2008)
///

for older versions than 2008

dim mydate as DateTime = CDate(31/12/2008)

Cor
 
R

rowe_newsgroups

I'm looking to convert a string in "dd/MM/yy" format into a date object. How
do I go about this ?

Intellisense is your friend.

You mention you want to Parse a string into a DateTime, so how about:

DateTime.Parse(...)

Thanks,

Seth Rowe [MVP]
 
H

Herfried K. Wagner [MVP]

Tony B said:
I'm looking to convert a string in "dd/MM/yy" format into a date object.
How do I go about this ?

'DateTime.ParseExact' + format string, if the date is always in the same
format regardless of the system's date/time format settings.
 

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

Similar Threads


Top