?
Solved

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

Posted on 2007-03-22
4
Medium Priority
?
21,964 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

719 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