Solved

Date format in Visual Studio 2010

Posted on 2011-02-17
3
2,568 Views
Last Modified: 2012-08-14
Hello all,

I was with VB6 before but i have now switch to Visual Studio 2010.

I need to adjust myself with some code.

I need to have a date format but in 2010, it does not work.

When i code:
lab_date.Text = Format(Date.Now, "dd mmm yyyy")

Open in new window


The result is: "18 02 2011" when it should be 18 Feb 2011.

What do i need to change?

Thanks for your help.
0
Comment
Question by:Wilder1626
[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
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
MrNed earned 500 total points
ID: 34922279
The help documentation has the format string in upper case (http://msdn.microsoft.com/en-us/library/73ctwf33(v=vs.71).aspx), try this:

lab_date.Text = Format(Date.Now, "dd MMM yyyy")
0
 
LVL 11

Author Comment

by:Wilder1626
ID: 34922314
I also just found out that i could use:

lab_date.Text = Format(Date.Now, "Long Date")

Open in new window

0
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 34922324
Thanks a lot for the quick response.
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

738 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