Date to String

Hi There,

I am new to .net world.

 How to convert a date format to string. i.e I have date = 09/14/2011, I want that date to be converted to a specific format. i.e 20110914

Please advice.

Thanks.
thearthaAsked:
Who is Participating?
 
Éric MoreauSenior .Net ConsultantCommented:
dim x as datetime
datetime.tryparse(yourtextbox.text, x)
dim y as string
y = x.tostring("yyyyMMdd")
0
 
Éric MoreauSenior .Net ConsultantCommented:
yourdatevariable.tostring("yyyyMMdd")
0
 
thearthaAuthor Commented:
@emoreau:

I am capturing the date as String from the text box and its value is 09/14/2011. Before passing the value to store procedure, I have convert the above value into 20110914 format.

Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.