Solved

Date format in Visual Studio 2010

Posted on 2011-02-17
3
2,623 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 19 hours left to enroll

628 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