Solved

Convert Date to MM/DD/YYYY - VB.net

Posted on 2007-03-22
4
21,925 Views
Last Modified: 2010-05-11
Unable to convert my date properly...Using VB.net 2003

Have
Dim Currentdate as date
currentdate = Format(Date.Today, "MM/dd/yyyy")

It gives me  Mar 22 2007.  
Need it to do:  03/22/2007
0
Comment
Question by:TechMonster
  • 3
4 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18774544
Why not just

currentDate=Date.Today
?
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18774562
currentDate=Date.Now.ToString("MM/dd/yyyy")

should work otherwise...
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 250 total points
ID: 18774578
or try...
currentDate = Format(Now, "MM/dd/yyyy")
0
 

Author Comment

by:TechMonster
ID: 18774825
Yeah..I figured out this formula..

currentdate = Format(Now, "d") ' Getting Date.  It gives me what I am looking for.  
I am actually writting this date to a SQL table which when it writes it writes: Mar 22 2007.
So, this is more of a SQL date format...

Thanks anyway..I am sure your code works too.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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