Solved

Date to String

Posted on 2011-09-14
3
283 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:theartha
  • 2
3 Comments
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 36537175
yourdatevariable.tostring("yyyyMMdd")
0
 

Author Comment

by:theartha
ID: 36537275
@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
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 36537376
dim x as datetime
datetime.tryparse(yourtextbox.text, x)
dim y as string
y = x.tostring("yyyyMMdd")
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now